From eb7581a13269c3fffc7a5eb79813d2033b6962a3 Mon Sep 17 00:00:00 2001 From: Paul-Elliot Date: Sun, 7 May 2023 21:02:58 +0200 Subject: [PATCH] WIP: fix duplicate NAKs This is just a hack to make the git clone work, need to be cleaned and verified! Signed-off-by: Paul-Elliot --- src/not-so-smart/upload_pack.ml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/not-so-smart/upload_pack.ml b/src/not-so-smart/upload_pack.ml index b97e0ed0e..ba8f2314a 100644 --- a/src/not-so-smart/upload_pack.ml +++ b/src/not-so-smart/upload_pack.ml @@ -133,16 +133,20 @@ struct match cmd with | `Done -> ( match Server_neg.last_common neg with - | Some ack -> - let ack = Smart.Negotiation.map ~f:to_hex ack in - Smart_flow.run sched fail io flow - Smart.(send ctx send_acks [ ack ]) - |> prj - >>= fun () -> return neg + | Some _ack -> + (* TODO: work out when to send NAKs to follow the protocol... *) + (* let ack = Smart.Negotiation.map ~f:to_hex ack in *) + (* Smart_flow.run sched fail io flow *) + (* Smart.(send ctx send_acks [ ack ]) *) + (* |> prj *) + (* >>= fun () -> return neg *) + return neg | None -> - Smart_flow.run sched fail io flow Smart.(send ctx send_acks []) - |> prj - >>= fun () -> return neg) + (* TODO: work out when to send NAKs to follow the protocol... *) + (* Smart_flow.run sched fail io flow Smart.(send ctx send_acks []) *) + (* |> prj *) + (* >>= fun () -> *) + return neg) | `Flush -> negotiate neg in negotiate Server_neg.empty >>= fun neg ->