summaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'http.go')
-rw-r--r--http.go12
1 files changed, 12 insertions, 0 deletions
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" {