diff --git a/handlePatches.go b/handlePatches.go index 4265e55..d5b12a9 100644 --- a/handlePatches.go +++ b/handlePatches.go @@ -32,9 +32,8 @@ func sendPendingPatches(pb *forgepb.Patches, reqPB *httppb.HttpRequest) *forgepb func sendPendingPatchsets(pb *forgepb.Patchsets, reqPB *httppb.HttpRequest) *forgepb.Patchsets { allPatchsetsPB := new(forgepb.Patchsets) for pset := range me.forge.Patchsets.IterAll() { - if pset.Name == "forge auto submit" { - allPatchsetsPB.Append(pset) - } + reqPB.Errors = append(reqPB.Errors, log.Sprintf("adding %s with len=%d", pset.Name, pset.Patches.Len())) + allPatchsetsPB.Append(pset) } return allPatchsetsPB } 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" {