AppendH2ToNextProtos appends h2 to next protos.
(ps []string)
| 26 | |
| 27 | // AppendH2ToNextProtos appends h2 to next protos. |
| 28 | func AppendH2ToNextProtos(ps []string) []string { |
| 29 | for _, p := range ps { |
| 30 | if p == alpnProtoStrH2 { |
| 31 | return ps |
| 32 | } |
| 33 | } |
| 34 | ret := make([]string, 0, len(ps)+1) |
| 35 | ret = append(ret, ps...) |
| 36 | return append(ret, alpnProtoStrH2) |
| 37 | } |
| 38 | |
| 39 | // CloneTLSConfig returns a shallow clone of the exported |
| 40 | // fields of cfg, ignoring the unexported sync.Once, which |
no outgoing calls