From 04413bd9ec7164a9956dc81a864e3441e3e18f1e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 29 Jan 2021 18:21:47 +0000 Subject: [PATCH] api: Add some extra debug for api op processing This helps debug the conflict protocol (PROTOCOL.md). Signed-off-by: Ian Jackson --- daemon/api.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/api.rs b/daemon/api.rs index 3633440e..c0ec99a1 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -129,6 +129,8 @@ fn api_piece_op(form : Json>) if client == pc.lastclient { pc.gen_before_lastclient } else { pc.gen }; + debug!("client={:?} pc.lastclient={:?} pc.gen_before={:?} pc.gen={:?} q_gen={:?} u_gen={:?}", &client, &pc.lastclient, &pc.gen_before_lastclient, &pc.gen, &q_gen, &u_gen); + if u_gen > q_gen { throw!(PieceOpError::Conflict) } form.op.check_held(pc,player)?; let (wrc, update, logents) = @@ -144,12 +146,14 @@ fn api_piece_op(form : Json>) &mut ig, poe, piece, vec![], client, &lens )?; + debug!("api_piece_op Err(RVU): {:?}", &form); }, Err(PartiallyProcessed(poe, logents)) => { PrepareUpdatesBuffer::piece_report_error( &mut ig, poe, piece, logents, client, &lens )?; + debug!("api_piece_op Err(PP): {:?}", &form); }, Err(ReportViaResponse(err)) => { warn!("api_piece_op ERROR {:?}: {:?}", &form, &err); -- 2.30.2