Source File
trace.go
Belonging Package
github.com/imroc/req/v3/internal/http2
// Copyright 2018 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package http2import ()func traceHasWroteHeaderField( *httptrace.ClientTrace) bool {return != nil && .WroteHeaderField != nil}func traceWroteHeaderField( *httptrace.ClientTrace, , string) {if != nil && .WroteHeaderField != nil {.WroteHeaderField(, []string{})}}func traceGot1xxResponseFunc( *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error {if != nil {return .Got1xxResponse}return nil}func traceGetConn( *http.Request, string) {:= httptrace.ContextClientTrace(.Context())if == nil || .GetConn == nil {return}.GetConn()}func traceGotConn( *http.Request, *ClientConn, bool) {:= httptrace.ContextClientTrace(.Context())if == nil || .GotConn == nil {return}:= httptrace.GotConnInfo{Conn: .tconn}.Reused =.mu.Lock().WasIdle = len(.streams) == 0 &&if .WasIdle && !.lastActive.IsZero() {.IdleTime = time.Now().Sub(.lastActive)}.mu.Unlock().GotConn()}func traceWroteHeaders( *httptrace.ClientTrace) {if != nil && .WroteHeaders != nil {.WroteHeaders()}}func traceGot100Continue( *httptrace.ClientTrace) {if != nil && .Got100Continue != nil {.Got100Continue()}}func traceWait100Continue( *httptrace.ClientTrace) {if != nil && .Wait100Continue != nil {.Wait100Continue()}}func traceWroteRequest( *httptrace.ClientTrace, error) {if != nil && .WroteRequest != nil {.WroteRequest(httptrace.WroteRequestInfo{Err: })}}func traceFirstResponseByte( *httptrace.ClientTrace) {if != nil && .GotFirstResponseByte != nil {.GotFirstResponseByte()}}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |