Serge Bazanski | cc25bdf | 2018-10-25 14:02:58 +0200 | [diff] [blame] | 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 | |
| 5 | // +build go1.11 |
| 6 | |
| 7 | package http2 |
| 8 | |
| 9 | import "net/textproto" |
| 10 | |
| 11 | func traceHasWroteHeaderField(trace *clientTrace) bool { |
| 12 | return trace != nil && trace.WroteHeaderField != nil |
| 13 | } |
| 14 | |
| 15 | func traceWroteHeaderField(trace *clientTrace, k, v string) { |
| 16 | if trace != nil && trace.WroteHeaderField != nil { |
| 17 | trace.WroteHeaderField(k, []string{v}) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | func traceGot1xxResponseFunc(trace *clientTrace) func(int, textproto.MIMEHeader) error { |
| 22 | if trace != nil { |
| 23 | return trace.Got1xxResponse |
| 24 | } |
| 25 | return nil |
| 26 | } |