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

Method unmarshal

handshake_messages.go:1789–1809  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

1787}
1788
1789func (m *newSessionTicketMsg) unmarshal(data []byte) bool {
1790 m.raw = data
1791
1792 if len(data) < 10 {
1793 return false
1794 }
1795
1796 length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3])
1797 if uint32(len(data))-4 != length {
1798 return false
1799 }
1800
1801 ticketLen := int(data[8])<<8 + int(data[9])
1802 if len(data)-10 != ticketLen {
1803 return false
1804 }
1805
1806 m.ticket = data[10:]
1807
1808 return true
1809}
1810
1811type helloRequestMsg struct {
1812}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected