Skip to content
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

Use httptrace GotConn instead of WroteHeaders #104

Merged
merged 1 commit into from
Oct 1, 2016

Conversation

moorereason
Copy link
Contributor

After doing some additional testing, it appears that the GotConn hook
fires after TLS has been established. TLS Handshake time is between
ConnectDone and GotConn.

After doing some additional testing, it appears that the GotConn hook
fires after TLS has been established.  TLS Handshake time is between
ConnectDone and GotConn.
@moorereason
Copy link
Contributor Author

I know it's dangerously close to release time, but I think this PR finally gets it right. Tested on linux-amd64 and windows-amd64.

Debug output from my iss90 branch:

$ ./http-gotconn -H "X-Factor: $BIG" https://requestb.in/19irncp1
. GetConn
. DNSStart 1.00682ms after GetConn
. DNSDone 15.979358ms after DNSStart
. ConnectStart 149.668µs after DNSDone

Connected to 104.31.86.204:443
. ConnectDone 14.033463ms after ConnectStart
. GotConn 149.985672ms after ConnectDone
. WroteHeaders: 840.739µs after GotConn
. . 150.825713ms after ConnectDone
. WroteRequest 1.126247ms after WroteHeaders
. GotFirstResponseByte 113.050125ms after WroteRequest

HTTP/2.0 200 OK
Server: cloudflare-nginx
Cf-Ray: 2eadeaf98e3858bb-DFW
Content-Type: text/html; charset=utf-8
Date: Sat, 01 Oct 2016 06:39:30 GMT
Set-Cookie: __cfduid=daab2a43aed262ac5cdac23e2f9e47cc51475303970; expires=Sun, 01-Oct-17 06:39:30 GMT; path=/; domain=.requestb.in; HttpOnly
Sponsored-By: https://www.runscope.com
Via: 1.1 vegur

Body discarded

  DNS Lookup   TCP Connection   TLS Handshake   Server Processing   Content Transfer
[     15ms  |          14ms  |        149ms  |            114ms  |             0ms  ]
            |                |               |                   |                  |
   namelookup:15ms           |               |                   |                  |
                       connect:30ms          |                   |                  |
                                   pretransfer:180ms             |                  |
                                                     starttransfer:294ms            |
                                                                                total:294ms    

@davecheney davecheney merged commit b893d35 into davecheney:master Oct 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants