1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 13:31:48 +02:00

Merge pull request #9157 from obsidiansystems/protocol-versions

Add protocol versions to `{Worker,Serve}Proto::*Conn`
This commit is contained in:
Robert Hensing 2023-10-20 15:34:26 +02:00 committed by GitHub
commit 4d17c59d8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 207 additions and 83 deletions

View file

@ -818,10 +818,16 @@ 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();
unsigned int clientVersion = readInt(in);
ServeProto::Version clientVersion = readInt(in);
ServeProto::ReadConn rconn { .from = in };
ServeProto::WriteConn wconn { .to = out };
ServeProto::ReadConn rconn {
.from = in,
.version = clientVersion,
};
ServeProto::WriteConn wconn {
.to = out,
.version = clientVersion,
};
auto getBuildSettings = [&]() {
// FIXME: changing options here doesn't work if we're