aboutsummaryrefslogtreecommitdiff
path: root/src/nix-daemon
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-04 12:53:24 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-04 12:53:24 +0200
commitb6c768fb6a341bf1c5fe4a2d2a929415e8519b25 (patch)
treec09b3177927190c117a0e7fe6dedbf92ce34377b /src/nix-daemon
parent4e17e7a4da4d82c3664b0b691c6a50debcb9e896 (diff)
nix-daemon: Fix queryPathInfo() backward compatibility
Diffstat (limited to 'src/nix-daemon')
-rw-r--r--src/nix-daemon/nix-daemon.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc
index 60ad85a68..bc05b85f4 100644
--- a/src/nix-daemon/nix-daemon.cc
+++ b/src/nix-daemon/nix-daemon.cc
@@ -518,14 +518,18 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe
}
stopWork();
if (info) {
- to << 1 << info->deriver << printHash(info->narHash) << info->references
+ if (GET_PROTOCOL_MINOR(clientVersion) >= 17)
+ to << 1;
+ to << info->deriver << printHash(info->narHash) << info->references
<< info->registrationTime << info->narSize;
if (GET_PROTOCOL_MINOR(clientVersion) >= 16) {
to << info->ultimate
<< info->sigs;
}
- } else
+ } else {
+ assert(GET_PROTOCOL_MINOR(clientVersion) >= 17);
to << 0;
+ }
break;
}