diff options
| author | Jeff Carr <[email protected]> | 2025-09-07 21:38:15 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-07 21:41:29 -0500 |
| commit | 873cb39932ae90fa9dac5415b08fd687c8ef3199 (patch) | |
| tree | da34bbb9a732264d726f2fd4ab2cd0e037a3230c /http.go | |
| parent | a099bbd3e656ac2d0cf1db656f08d91c673db437 (diff) | |
patches being sent again when requested
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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" { |
