From cf86a098cf93edb29e0b53e4d6e56ed05e7ee2ed Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 18 Apr 2024 12:36:08 +0300 Subject: feat(tvix/nix-compat/nix_daemon/version): add ProtocolVersion This provides a nice wrapper struct to deal with versions. Change-Id: I6acc03bc9f8d84a0583196073b52776c45d3fe92 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11454 Autosubmit: flokli Tested-by: BuildkiteCI Reviewed-by: picnoir picnoir --- users/picnoir/tvix-daemon/src/main.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'users/picnoir/tvix-daemon/src') diff --git a/users/picnoir/tvix-daemon/src/main.rs b/users/picnoir/tvix-daemon/src/main.rs index 27bec90ce47f..102067fcf7d4 100644 --- a/users/picnoir/tvix-daemon/src/main.rs +++ b/users/picnoir/tvix-daemon/src/main.rs @@ -3,8 +3,8 @@ use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio_listener::{self, SystemOptions, UserOptions}; use tracing::{debug, error, info, instrument, Level}; -use nix_compat::wire; use nix_compat::worker_protocol::{self, server_handshake_client, ClientSettings, Trust}; +use nix_compat::{wire, ProtocolVersion}; #[derive(Parser, Debug)] struct Cli { @@ -55,7 +55,7 @@ async fn main() { #[derive(Debug)] struct ClientConnection { pub conn: R, - pub version_minor: u64, + pub version: ProtocolVersion, pub client_settings: Option, } @@ -70,7 +70,7 @@ where Ok(client_protocol_version) => { let mut client_connection = ClientConnection { conn, - version_minor: client_protocol_version, + version: client_protocol_version, client_settings: None, }; debug!("Client hanshake succeeded"); @@ -106,8 +106,7 @@ async fn op_set_options(conn: &mut ClientConnection) -> std::io::Result