(ss *tls.SessionState)
| 21 | } |
| 22 | |
| 23 | func TLSSessionIDFromState(ss *tls.SessionState) (TLSSessionID, bool) { |
| 24 | for _, tag := range ss.Extra { |
| 25 | if !bytes.HasPrefix(tag, []byte(tlsCookiePrefix)) { |
| 26 | continue |
| 27 | } |
| 28 | tag = tag[len(tlsCookiePrefix):] |
| 29 | if len(tag) != len(TLSSessionID{}) { |
| 30 | continue |
| 31 | } |
| 32 | return TLSSessionID(tag), true |
| 33 | } |
| 34 | return TLSSessionID{}, false |
| 35 | } |
| 36 | |
| 37 | type tlsSessionIDKey struct{} |
| 38 | type connKey struct{} |