Skip to content

Commit fcdcb19

Browse files
committed
net/http: document internal error errServerClosedIdle more
Updates #19943 Change-Id: Iea249be51a7af3264bee9ee2b28dbd91043275fc Reviewed-on: https://go-review.googlesource.com/86375 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 596e3d9 commit fcdcb19

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/net/http/transport.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,14 @@ var (
655655
errTooManyIdleHost = errors.New("http: putIdleConn: too many idle connections for host")
656656
errCloseIdleConns = errors.New("http: CloseIdleConnections called")
657657
errReadLoopExiting = errors.New("http: persistConn.readLoop exiting")
658-
errServerClosedIdle = errors.New("http: server closed idle connection")
659658
errIdleConnTimeout = errors.New("http: idle connection timeout")
660659
errNotCachingH2Conn = errors.New("http: not caching alternate protocol's connections")
660+
661+
// errServerClosedIdle is not seen by users for idempotent requests, but may be
662+
// seen by a user if the server shuts down an idle connection and sends its FIN
663+
// in flight with already-written POST body bytes from the client.
664+
// See https://github.com/golang/go/issues/19943#issuecomment-355607646
665+
errServerClosedIdle = errors.New("http: server closed idle connection")
661666
)
662667

663668
// transportReadFromServerError is used by Transport.readLoop when the

0 commit comments

Comments
 (0)