MCPcopy Create free account
hub / github.com/facebook/time / checkPacketLength

Function checkPacketLength

ptp/protocol/protocol.go:124–129  ·  view source on GitHub ↗
(p *Header, l int)

Source from the content-addressed store, hash-verified

122}
123
124func checkPacketLength(p *Header, l int) error {
125 if int(p.MessageLength) > l {
126 return fmt.Errorf("cannot decode message of length %d from %d bytes", p.MessageLength, l)
127 }
128 return nil
129}
130
131// headerMarshalBinaryTo is not a Header.MarshalBinaryTo to prevent all packets
132// from having default (and incomplete) MarshalBinaryTo implementation through embedding

Callers 5

UnmarshalBinaryMethod · 0.85
UnmarshalBinaryMethod · 0.85
UnmarshalBinaryMethod · 0.85
UnmarshalBinaryMethod · 0.85
UnmarshalBinaryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…