From 3097cea3a4f9b3b3903e0f16c8789d74a125aa71 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Wed, 20 Sep 2017 12:45:24 -0400 Subject: [PATCH] make it work --- contrib/backends/srndv2/src/srnd/nntp.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index b3c71fb..ba1a9cf 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -68,7 +68,7 @@ type nntpConnection struct { // ARTICLE article chan string // map of message-id -> stream state - pending map[string]syncEvent + pending map[string]*syncEvent // lock for accessing self.pending map pending_access sync.Mutex @@ -122,7 +122,7 @@ func createNNTPConnection(addr string) *nntpConnection { return &nntpConnection{ hostname: host, article: make(chan string, 1024), - pending: make(map[string]syncEvent), + pending: make(map[string]*syncEvent), } } @@ -297,6 +297,7 @@ func (self *nntpConnection) handleStreamEvent(ev nntpStreamEvent, daemon *NNTPDa } } else if cmd == "CHECK" { conn.PrintfLine("%s", ev) + self.pending[msgid].state = "pending" } else { log.Println("invalid stream command", ev) } @@ -330,7 +331,7 @@ func (self *nntpConnection) messageSetPendingState(msgid, state string, sz int64 s.state = state self.pending[msgid] = s } else { - self.pending[msgid] = syncEvent{msgid: msgid, sz: sz, state: state} + self.pending[msgid] = &syncEvent{msgid: msgid, sz: sz, state: state} } self.pending_access.Unlock() }