From 873cb39932ae90fa9dac5415b08fd687c8ef3199 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 7 Sep 2025 21:38:15 -0500 Subject: patches being sent again when requested --- http.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'http.go') diff --git a/http.go b/http.go index 0714758..11c0a49 100644 --- a/http.go +++ b/http.go @@ -48,8 +48,15 @@ func whoSent(r *http.Request) string { return log.Sprintf("%s\t%s", getClientIP(r), r.Header.Get("hostname")) } +func logReqPB(pb *httppb.HttpRequest) { + log.Info("LOG: httppb.HttpRequest Errors START:") + log.Info(strings.Join(pb.Errors, "\n")) + log.Info("LOG: httppb.HttpRequest Errors END") +} + func okHandler(w http.ResponseWriter, r *http.Request) { reqPB, err := httppb.ReqToPB(r) + reqPB.Errors = append(reqPB.Errors, fmt.Sprintf("START: Got %d bytes from the client", len(reqPB.Body))) if err != nil { log.Info("something crazy err", err) } @@ -93,6 +100,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { log.Info("Oh well, Send to client failed. err =", err) } // todo: logReq(reqPB) + logReqPB(reqPB) return } @@ -116,6 +124,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } me.forge.SavePatchsets() // todo: logReq(reqPB) + logReqPB(reqPB) return } @@ -134,10 +143,13 @@ func okHandler(w http.ResponseWriter, r *http.Request) { if err := result.SendReply(w, reqPB); err != nil { log.Info("Oh well, Send to client failed. err =", err) } + log.Info("Send to client seems to have worked. errors:", reqPB.Errors) me.forge.SavePatchsets() // todo: logReq(reqPB) + logReqPB(reqPB) return } + logReqPB(reqPB) /* if route == "/patchset" { -- cgit v1.2.3