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
Showing
Please register or sign in to comment