From 5671188eb2822b7392a6affa5ebe2f1eb8f521a0 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 7 Feb 2014 16:56:00 -0500 Subject: nix-store --serve: Flush out after every loop Signed-off-by: Shea Levy --- src/libstore/store-api.cc | 3 ++- src/libstore/store-api.hh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index bd95590756de..e4f180240992 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -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); if (cmd == "query") { @@ -283,6 +283,7 @@ void StoreAPI::serve(Source & in, Sink & out) writeString("", out); } else throw Error(format("Unknown serve query `%1%'") % cmd); + out.flush(); } } else if (cmd == "substitute") dumpPath(readString(in), out); diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index edab6ea5a2d9..f32824a3bb7c 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -251,7 +251,7 @@ public: /* Serve the store for ssh substituters by taking commands * from in and printing results to out */ - void serve(Source & in, Sink & out); + void serve(Source & in, BufferedSink & out); }; -- cgit 1.4.1