Skip to content

Commit

Permalink
Use httptrace WroteHeaders instead of WroteRequest (#102)
Browse files Browse the repository at this point in the history
When POSTing a large request, the TLS Handshake timings become very
skewed. Using WroteHeaders is about the best we can do for now until
httptrace adds additional hooks.
  • Loading branch information
moorereason authored and davecheney committed Oct 1, 2016
1 parent 68487ee commit d5cbd23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func visit(url *url.URL) {

printf("\n%s%s\n", color.GreenString("Connected to "), color.CyanString(addr))
},
WroteRequest: func(_ httptrace.WroteRequestInfo) { t3 = time.Now() },
WroteHeaders: func() { t3 = time.Now() },
GotFirstResponseByte: func() { t4 = time.Now() },
}
req = req.WithContext(httptrace.WithClientTrace(context.Background(), trace))
Expand Down

0 comments on commit d5cbd23

Please sign in to comment.