From 1abda8e17311fbfc27b751b90aff4f691f496b0f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 6 Oct 2015 17:33:30 +0200 Subject: nix-store --serve: Implement log size limit --- src/nix-store/nix-store.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nix-store/nix-store.cc') diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index d541b7b7d..89518bfb1 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -853,7 +853,7 @@ static void opServe(Strings opFlags, Strings opArgs) if (magic != SERVE_MAGIC_1) throw Error("protocol mismatch"); out << SERVE_MAGIC_2 << SERVE_PROTOCOL_VERSION; out.flush(); - readInt(in); // Client version, unused for now + unsigned int clientVersion = readInt(in); auto getBuildSettings = [&]() { // FIXME: changing options here doesn't work if we're @@ -863,6 +863,8 @@ static void opServe(Strings opFlags, Strings opArgs) settings.useSubstitutes = false; settings.maxSilentTime = readInt(in); settings.buildTimeout = readInt(in); + if (GET_PROTOCOL_MINOR(clientVersion) >= 2) + settings.maxLogSize = readInt(in); }; while (true) { -- cgit v1.2.3