]> Cypherpunks repositories - gostls13.git/commit
net/http: fix location of StateHijacked and StateActive
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 4 Mar 2014 02:58:28 +0000 (18:58 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 4 Mar 2014 02:58:28 +0000 (18:58 -0800)
commit709b12ffe63b6f13a344286f9ff6afed7c283887
treef1124224e1c608b707553bf14a2e987d174c2f67
parentdf8b63780b9331ea1860eae6432b047a7c8ea08e
net/http: fix location of StateHijacked and StateActive

1) Move StateHijacked callback earlier, to make it
panic-proof.  A Hijack followed by a panic didn't previously
result in ConnState getting fired for StateHijacked.  Move it
earlier, to the time of hijack.

2) Don't fire StateActive unless any bytes were read off the
wire while waiting for a request. This means we don't
transition from New or Idle to Active if the client
disconnects or times out. This was documented before, but not
implemented properly.

This CL is required for an pending fix for Issue 7264

LGTM=josharian
R=josharian
CC=golang-codereviews
https://golang.org/cl/69860049
src/pkg/net/http/serve_test.go
src/pkg/net/http/server.go