From 942294317afb1fd6cd8b860d271c3cddf54c0579 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sun, 23 Apr 2017 08:30:28 -0400 Subject: [PATCH] make backend die when streaming is done --- contrib/backends/srndv2/src/srnd/nntp.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index e6dafc0..55d6572 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -1225,14 +1225,11 @@ func (self *nntpConnection) handleLine(daemon *NNTPDaemon, code int, line string func (self *nntpConnection) startStreaming(daemon *NNTPDaemon, reader bool, conn *textproto.Conn) { self.keepalive = time.NewTicker(time.Minute) defer self.keepalive.Stop() - for { - err := self.handleStreaming(daemon, conn) - if err == nil { - log.Println(self.name, "done with streaming") - return - } else { - log.Println(self.name, "error while streaming:", err) - } + err := self.handleStreaming(daemon, conn) + if err == nil { + log.Println(self.name, "done with streaming") + } else { + log.Println(self.name, "error while streaming:", err) } }