From f36057d23d5de636e2bb1748738772bf031bebdb Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 2 Jul 2023 13:57:28 -0700 Subject: use new protocol bits when ackinga task request --- src/ci_driver.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ci_driver.rs b/src/ci_driver.rs index 710272d..e3cc4c9 100644 --- a/src/ci_driver.rs +++ b/src/ci_driver.rs @@ -432,19 +432,24 @@ async fn handle_next_job(State(ctx): State<(Arc, mpsc::Sender v, Err(e) => { eprintln!("couldn't parse work request: {:?}", e); return (StatusCode::MISDIRECTED_REQUEST, resp_body).into_response(); } }; - if &request.kind != "new_job_please" { - eprintln!("bad request kind: {:?}", &request.kind); - return (StatusCode::MISDIRECTED_REQUEST, resp_body).into_response(); - } + let (accepted_pushers, host_info) = match request { + ClientProto::NewTaskPlease { allowed_pushers, host_info } => (allowed_pushers, host_info), + other => { + eprintln!("bad request kind: {:?}", &other); + return (StatusCode::MISDIRECTED_REQUEST, resp_body).into_response(); + } + }; + + eprintln!("client identifies itself as {:?}", host_info); - let client = match RunnerClient::new(tx_sender, job_resp, request.accepted_pushers).await { + let client = match RunnerClient::new(tx_sender, job_resp, accepted_pushers).await { Ok(v) => v, Err(e) => { eprintln!("unable to register client"); -- cgit v1.1