From 8894cf6814cba956e326d56ae42a7040e5c6db2e Mon Sep 17 00:00:00 2001 From: cathugger Date: Wed, 24 Jan 2018 15:39:37 +0000 Subject: [PATCH 1/4] im retarded --- contrib/backends/srndv2/src/srnd/nntp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index c9d6c5e..0e44572 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -1324,7 +1324,7 @@ func (self *nntpConnection) scrapeGroup(daemon *NNTPDaemon, conn *textproto.Conn // success es, lo, hi, _ := interpretGroupResult(ret) for { - if lo < hi { + if lo > hi { // server indicated empty group // or // we finished pulling stuff From 9fba95b58d509e69b36204a8a4e631fd5dea9672 Mon Sep 17 00:00:00 2001 From: cathugger Date: Wed, 24 Jan 2018 15:57:13 +0000 Subject: [PATCH 2/4] fix even more braindamage of mine --- contrib/backends/srndv2/src/srnd/nntp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index 0e44572..da2641f 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -1330,7 +1330,7 @@ func (self *nntpConnection) scrapeGroup(daemon *NNTPDaemon, conn *textproto.Conn // we finished pulling stuff break } - if lo-hi+1 <= maxXOVERRange { + if hi-lo+1 <= maxXOVERRange { // not too much for us to pull if es == 0 && lo == 0 && hi == 0 { // empty group From 6b039265d9986a1f0aa15d94f07cd7901b8fc931 Mon Sep 17 00:00:00 2001 From: cathugger Date: Wed, 24 Jan 2018 16:21:51 +0000 Subject: [PATCH 3/4] small insignificant fix --- contrib/backends/srndv2/src/srnd/nntp.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index da2641f..31e791d 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -1395,8 +1395,8 @@ func (self *nntpConnection) scrapeGroup(daemon *NNTPDaemon, conn *textproto.Conn if err != nil { // something bad happened log.Println(self.name, "failed to obtain root post", refid, err) - // trying with another article isn't bad idea - err = nil + // it fails only when REALLY bad stuff happens + return } } } @@ -1413,8 +1413,8 @@ func (self *nntpConnection) scrapeGroup(daemon *NNTPDaemon, conn *textproto.Conn if err != nil { // something bad happened log.Println(self.name, "failed to obtain article", msgid, err) - // trying with another article isn't bad idea - err = nil + // it fails only when REALLY bad stuff happens + return } } } From 81653a5415e461dc1831520f3f7d1cc6bba1c82e Mon Sep 17 00:00:00 2001 From: cathugger Date: Fri, 26 Jan 2018 14:46:59 +0000 Subject: [PATCH 4/4] small sync tweak --- contrib/backends/srndv2/src/srnd/nntp.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index 31e791d..2eb2512 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -1372,6 +1372,11 @@ func (self *nntpConnection) scrapeGroup(daemon *NNTPDaemon, conn *textproto.Conn msgid := parts[4] // msgid -> reference articles[msgid] = parts[5] + // incase server returned more articles than we requested + if num, nerr := strconv.ParseUint(parts[0], 10, 64); nerr == nil && num >= lo { + // fix lo so that we wont request them again + lo = num + 1 + } } else { // probably not valid line // ignore