Browse Source

Merge branch '_log_leftover_url' into _product

pull/5936/head
changlin.shi 2 years ago
parent
commit
834f4cc7ee
  1. 13
      weed/util/http_util.go

13
weed/util/http_util.go

@ -415,7 +415,11 @@ func CloseResponse(resp *http.Response) {
io.Copy(io.Discard, reader) io.Copy(io.Discard, reader)
resp.Body.Close() resp.Body.Close()
if reader.BytesRead > 0 { if reader.BytesRead > 0 {
glog.V(1).Infof("response leftover %d bytes", reader.BytesRead)
if resp.Request != nil && resp.Request.URL != nil {
glog.V(1).Infof("response leftover %d bytes, url: %s", resp.Request.URL.RequestURI())
} else {
glog.V(1).Infof("response leftover %d bytes", reader.BytesRead)
}
} }
} }
@ -424,7 +428,12 @@ func CloseRequest(req *http.Request) {
io.Copy(io.Discard, reader) io.Copy(io.Discard, reader)
req.Body.Close() req.Body.Close()
if reader.BytesRead > 0 { if reader.BytesRead > 0 {
glog.V(1).Infof("request leftover %d bytes", reader.BytesRead)
if req.URL != nil {
glog.V(1).Infof("request leftover %d bytes, url: %s", reader.BytesRead, req.URL.RequestURI())
} else {
glog.V(1).Infof("request leftover %d bytes", reader.BytesRead)
}
} }
} }

Loading…
Cancel
Save