MCPcopy Index your code
hub / github.com/tailscale/tailscale / Write

Method Write

wgengine/netstack/link_endpoint.go:63–76  ·  view source on GitHub ↗
(pkt *stack.PacketBuffer)

Source from the content-addressed store, hash-verified

61}
62
63func (q *queue) Write(pkt *stack.PacketBuffer) tcpip.Error {
64 q.mu.RLock()
65 defer q.mu.RUnlock()
66 if q.closed {
67 return &tcpip.ErrClosedForSend{}
68 }
69 select {
70 case q.c <- pkt.IncRef():
71 return nil
72 case <-q.closedCh:
73 pkt.DecRef()
74 return &tcpip.ErrClosedForSend{}
75 }
76}
77
78func (q *queue) Drain() int {
79 c := 0

Callers

nothing calls this directly

Calls 1

DecRefMethod · 0.80

Tested by

no test coverage detected