MCPcopy Index your code
hub / github.com/foxcpp/maddy / readUpdates

Method readUpdates

internal/updatepipe/unix_pipe.go:60–75  ·  view source on GitHub ↗
(conn net.Conn, updCh chan<- mess.Update)

Source from the content-addressed store, hash-verified

58}
59
60func (usp *UnixSockPipe) readUpdates(conn net.Conn, updCh chan<- mess.Update) {
61 scnr := bufio.NewScanner(conn)
62 for scnr.Scan() {
63 id, upd, err := parseUpdate(scnr.Text())
64 if err != nil {
65 usp.Log.Error("malformed update received", err, "str", scnr.Text())
66 }
67
68 // It is our own update, skip.
69 if id == usp.myID() {
70 continue
71 }
72
73 updCh <- *upd
74 }
75}
76
77func (usp *UnixSockPipe) Listen(upd chan<- mess.Update) error {
78 l, err := netresource.Listen("unix", usp.SockPath)

Callers 1

ListenMethod · 0.95

Calls 3

myIDMethod · 0.95
parseUpdateFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected