go111.go 647 B

1234567891011121314151617181920212223242526
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build go1.11
  5. package http2
  6. import "net/textproto"
  7. func traceHasWroteHeaderField(trace *clientTrace) bool {
  8. return trace != nil && trace.WroteHeaderField != nil
  9. }
  10. func traceWroteHeaderField(trace *clientTrace, k, v string) {
  11. if trace != nil && trace.WroteHeaderField != nil {
  12. trace.WroteHeaderField(k, []string{v})
  13. }
  14. }
  15. func traceGot1xxResponseFunc(trace *clientTrace) func(int, textproto.MIMEHeader) error {
  16. if trace != nil {
  17. return trace.Got1xxResponse
  18. }
  19. return nil
  20. }