nix-store --serve: Flush out after every loop

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2014-02-07 16:56:00 -05:00
parent 73874629ef
commit 5671188eb2
2 changed files with 3 additions and 2 deletions

View file

@ -259,7 +259,7 @@ string StoreAPI::makeValidityRegistration(const PathSet & paths,
} }
void StoreAPI::serve(Source & in, Sink & out) void StoreAPI::serve(Source & in, BufferedSink & out)
{ {
string cmd = readString(in); string cmd = readString(in);
if (cmd == "query") { if (cmd == "query") {
@ -283,6 +283,7 @@ void StoreAPI::serve(Source & in, Sink & out)
writeString("", out); writeString("", out);
} else } else
throw Error(format("Unknown serve query `%1%'") % cmd); throw Error(format("Unknown serve query `%1%'") % cmd);
out.flush();
} }
} else if (cmd == "substitute") } else if (cmd == "substitute")
dumpPath(readString(in), out); dumpPath(readString(in), out);

View file

@ -251,7 +251,7 @@ public:
/* Serve the store for ssh substituters by taking commands /* Serve the store for ssh substituters by taking commands
* from in and printing results to out */ * from in and printing results to out */
void serve(Source & in, Sink & out); void serve(Source & in, BufferedSink & out);
}; };