MCPcopy Create free account
hub / github.com/XTLS/Go / marshal

Method marshal

handshake_messages.go:1767–1787  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1765}
1766
1767func (m *newSessionTicketMsg) marshal() (x []byte) {
1768 if m.raw != nil {
1769 return m.raw
1770 }
1771
1772 // See RFC 5077, Section 3.3.
1773 ticketLen := len(m.ticket)
1774 length := 2 + 4 + ticketLen
1775 x = make([]byte, 4+length)
1776 x[0] = typeNewSessionTicket
1777 x[1] = uint8(length >> 16)
1778 x[2] = uint8(length >> 8)
1779 x[3] = uint8(length)
1780 x[8] = uint8(ticketLen >> 8)
1781 x[9] = uint8(ticketLen)
1782 copy(x[10:], m.ticket)
1783
1784 m.raw = x
1785
1786 return
1787}
1788
1789func (m *newSessionTicketMsg) unmarshal(data []byte) bool {
1790 m.raw = data

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected