[ARVADOS] updated: 1.3.0-1788-g868833828

Git user git at public.curoverse.com
Thu Oct 24 20:19:24 UTC 2019


Summary of changes:
 sdk/go/httpserver/responsewriter.go | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

       via  868833828599674d566e1c9550a035d5d8002076 (commit)
       via  e701875382821088123769823f6b66a5a4ae2907 (commit)
      from  7db3ceda16742b65d73ebbc05d02351a5e0496bd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 868833828599674d566e1c9550a035d5d8002076
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Oct 24 16:16:07 2019 -0400

    15713: Log status sent to client if WriteHeader() is called >1x.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/sdk/go/httpserver/responsewriter.go b/sdk/go/httpserver/responsewriter.go
index 884f0d8d7..049a3f1aa 100644
--- a/sdk/go/httpserver/responsewriter.go
+++ b/sdk/go/httpserver/responsewriter.go
@@ -22,7 +22,7 @@ type ResponseWriter interface {
 // error.
 type responseWriter struct {
 	http.ResponseWriter
-	wroteStatus    int   // Last status given to WriteHeader()
+	wroteStatus    int   // First status given to WriteHeader()
 	wroteBodyBytes int   // Bytes successfully written
 	err            error // Last error returned from Write()
 	sniffed        []byte
@@ -40,7 +40,12 @@ func (w *responseWriter) CloseNotify() <-chan bool {
 }
 
 func (w *responseWriter) WriteHeader(s int) {
-	w.wroteStatus = s
+	if w.wroteStatus == 0 {
+		w.wroteStatus = s
+	}
+	// ...else it's too late to change the status seen by the
+	// client -- but we call the wrapped WriteHeader() anyway so
+	// it can log a warning.
 	w.ResponseWriter.WriteHeader(s)
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list