MCPcopy
hub / github.com/syncthing/syncthing / IndexUpdate

Method IndexUpdate

lib/protocol/protocol.go:333–345  ·  view source on GitHub ↗

IndexUpdate writes the list of file information to the connected peer device as an update

(ctx context.Context, idxUp *IndexUpdate)

Source from the content-addressed store, hash-verified

331
332// IndexUpdate writes the list of file information to the connected peer device as an update
333func (c *rawConnection) IndexUpdate(ctx context.Context, idxUp *IndexUpdate) error {
334 select {
335 case <-c.closed:
336 return ErrClosed
337 case <-ctx.Done():
338 return ctx.Err()
339 default:
340 }
341 c.idxMut.Lock()
342 c.send(ctx, idxUp.toWire(), nil)
343 c.idxMut.Unlock()
344 return nil
345}
346
347// Request returns the bytes for the specified block after fetching them from the connected peer.
348func (c *rawConnection) Request(ctx context.Context, req *Request) ([]byte, error) {

Callers

nothing calls this directly

Calls 4

sendMethod · 0.95
DoneMethod · 0.80
UnlockMethod · 0.80
toWireMethod · 0.45

Tested by

no test coverage detected