New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: Transport: add ConnState callback for http.Transport #9194
Labels
Milestone
Comments
As discussed last night, I'm not against this, but it's just lower priority than the Server because at least you're in control of the client more. And I'm not entirely convinced (without thinking about it much) that the same states apply. Please write a proposal (here works) about which states apply and what they mean for the client. Status changed to WaitingForReply. |
Comment 3 by sasha.klizhentas@mailgunhq.com: Sure! Here are the possible states: 1.StateNew when new connection is created in the transport http://golang.org/src/pkg/net/http/transport.go?s=472:472#L472 2. StateActive state when conn wrote request headers: http://golang.org/src/pkg/net/http/transport.go?s=891:891#L891 I think this would need cooperation with request.write to tell us when the request headers were written 3. StateClosed state when persistent connection is closed c.setState(pc, StateClosed) http://golang.org/src/pkg/net/http/transport.go?s=1074:1074#L1074 4. StateIdle state when connection is returned to the pool http://golang.org/src/pkg/net/http/transport.go?s=329:329#L329 Looks like Hijacked state is not relevant in case of transports. Let me know what you think! |
Looking through old bugs ... this is (almost) obsoleted by net/http/httptrace:
If StateClosed is still desired, it may be possible to add CloseConn. Otherwise, we can close this issue. |
@tombergan, thanks. Yeah, it seems like we can close this one. People can open separate bugs to track httptrace shortcomings. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by sasha.klizhentas@mailgunhq.com:
The text was updated successfully, but these errors were encountered: