about summary refs log tree commit diff
path: root/src/nix-worker/nix-worker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-worker/nix-worker.cc')
-rw-r--r--src/nix-worker/nix-worker.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc
index b9d5b1e26309..9f387a4ec130 100644
--- a/src/nix-worker/nix-worker.cc
+++ b/src/nix-worker/nix-worker.cc
@@ -414,6 +414,19 @@ static void performOp(Source & from, Sink & to, unsigned int op)
         
         break;
     }
+
+    case wopSetOptions: {
+        keepFailed = readInt(from) != 0;
+        keepGoing = readInt(from) != 0;
+        tryFallback = readInt(from) != 0;
+        verbosity = (Verbosity) readInt(from);
+        maxBuildJobs = readInt(from);
+        maxSilentTime = readInt(from);
+        startWork();
+        stopWork();
+        break;
+    }
+            
             
     default:
         throw Error(format("invalid operation %1%") % op);
@@ -437,14 +450,19 @@ static void processConnection()
     /* Exchange the greeting. */
     unsigned int magic = readInt(from);
     if (magic != WORKER_MAGIC_1) throw Error("protocol mismatch");
-    verbosity = (Verbosity) readInt(from);
     writeInt(WORKER_MAGIC_2, to);
 
+    writeInt(PROTOCOL_VERSION, to);
+    unsigned int clientVersion = readInt(from);
+
     /* Send startup error messages to the client. */
     startWork();
 
     try {
 
+        /* If we can't accept clientVersion, then throw an error
+           *here* (not above). */
+
         /* Prevent users from doing something very dangerous. */
         if (geteuid() == 0 &&
             querySetting("build-users-group", "") == "")