]> Cypherpunks repositories - gostls13.git/commit
net/http: fix rare Transport readLoop goroutine leak
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 21 Apr 2015 20:13:16 +0000 (13:13 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 22 Apr 2015 10:29:22 +0000 (10:29 +0000)
commit58c1c011a694cc9a813b34c83eebab223edae1fd
tree77c7c19fb12ca7cc87e02a4ed015dcb84f9bb350
parent87054c4704edbfc5c16e109e9c3f12f0f57a9a13
net/http: fix rare Transport readLoop goroutine leak

There used to be a small window where if a server declared it would do
a keep-alive connection but then actually closed the connection before
the roundTrip goroutine scheduled after being sent a response from the
readLoop goroutine, then the readLoop goroutine would loop around and
block forever reading from a channel because the numExpectedResponses
accounting was done too late.

Fixes #10457

Change-Id: Icbae937ffe83c792c295b7f4fb929c6a24a4f759
Reviewed-on: https://go-review.googlesource.com/9169
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/transport.go
src/net/http/transport_test.go