upstream: sync to 0.39.1

This commit is contained in:
Gaukas Wang 2023-10-26 22:45:37 -06:00
commit 7c77243b04
No known key found for this signature in database
GPG key ID: 9E2F8986D76F8B5D
147 changed files with 3740 additions and 2211 deletions

View file

@ -166,9 +166,10 @@ func (w *responseWriter) Write(p []byte) (int, error) {
w.buf = w.buf[:0]
w.buf = df.Append(w.buf)
if _, err := w.bufferedStr.Write(w.buf); err != nil {
return 0, err
return 0, maybeReplaceError(err)
}
return w.bufferedStr.Write(p)
n, err := w.bufferedStr.Write(p)
return n, maybeReplaceError(err)
}
func (w *responseWriter) FlushError() error {
@ -177,7 +178,7 @@ func (w *responseWriter) FlushError() error {
}
if !w.written {
if err := w.writeHeader(); err != nil {
return err
return maybeReplaceError(err)
}
w.written = true
}