MCPcopy
hub / github.com/syncthing/syncthing / readMessage

Method readMessage

lib/protocol/protocol.go:506–513  ·  view source on GitHub ↗
(fourByteBuf []byte)

Source from the content-addressed store, hash-verified

504}
505
506func (c *rawConnection) readMessage(fourByteBuf []byte) (proto.Message, error) {
507 hdr, err := c.readHeader(fourByteBuf)
508 if err != nil {
509 return nil, err
510 }
511
512 return c.readMessageAfterHeader(hdr, fourByteBuf)
513}
514
515func (c *rawConnection) readMessageAfterHeader(hdr *bep.Header, fourByteBuf []byte) (proto.Message, error) {
516 // First comes a 4 byte message length

Callers 2

TestWriteCompressedFunction · 0.95
readerLoopMethod · 0.95

Calls 2

readHeaderMethod · 0.95

Tested by 1

TestWriteCompressedFunction · 0.76