]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document internal error errServerClosedIdle more
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 5 Jan 2018 17:03:51 +0000 (17:03 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 5 Jan 2018 18:30:56 +0000 (18:30 +0000)
Updates #19943

Change-Id: Iea249be51a7af3264bee9ee2b28dbd91043275fc
Reviewed-on: https://go-review.googlesource.com/86375
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/http/transport.go

index 7c38ac4464db75eba87b4f3da2ba0e5bbc680ca1..c9758e9b38c4366d208ade7b3220c56d782fc5eb 100644 (file)
@@ -655,9 +655,14 @@ var (
        errTooManyIdleHost    = errors.New("http: putIdleConn: too many idle connections for host")
        errCloseIdleConns     = errors.New("http: CloseIdleConnections called")
        errReadLoopExiting    = errors.New("http: persistConn.readLoop exiting")
-       errServerClosedIdle   = errors.New("http: server closed idle connection")
        errIdleConnTimeout    = errors.New("http: idle connection timeout")
        errNotCachingH2Conn   = errors.New("http: not caching alternate protocol's connections")
+
+       // errServerClosedIdle is not seen by users for idempotent requests, but may be
+       // seen by a user if the server shuts down an idle connection and sends its FIN
+       // in flight with already-written POST body bytes from the client.
+       // See https://github.com/golang/go/issues/19943#issuecomment-355607646
+       errServerClosedIdle = errors.New("http: server closed idle connection")
 )
 
 // transportReadFromServerError is used by Transport.readLoop when the