From e0350ecb9875febbf4a3e247a11e070dcb20fae1 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 29 Dec 2017 13:08:42 -0500 Subject: [PATCH] more fixes --- contrib/backends/srndv2/src/srnd/nntp.go | 1 - contrib/backends/srndv2/src/srnd/util.go | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/nntp.go b/contrib/backends/srndv2/src/srnd/nntp.go index 440d7e3..58f7750 100644 --- a/contrib/backends/srndv2/src/srnd/nntp.go +++ b/contrib/backends/srndv2/src/srnd/nntp.go @@ -1434,7 +1434,6 @@ func (self *nntpConnection) scrapeServer(daemon *NNTPDaemon, conn *textproto.Con // feed it to the daemon if we get it func (self *nntpConnection) requestArticle(daemon *NNTPDaemon, conn *textproto.Conn, msgid string) (err error) { if daemon.store.HasArticle(msgid) { - log.Println("already have", msgid, "so not requesting it") return } // send command diff --git a/contrib/backends/srndv2/src/srnd/util.go b/contrib/backends/srndv2/src/srnd/util.go index 6752506..9ba8180 100644 --- a/contrib/backends/srndv2/src/srnd/util.go +++ b/contrib/backends/srndv2/src/srnd/util.go @@ -278,7 +278,9 @@ func decAddr(encaddr, key string) string { res_bytes[idx] = encaddr_bytes[idx] ^ b } res := string(res_bytes) - res = strings.Trim(res, " ") + res = strings.TrimFunc(res, func(r rune) bool { + return r > 57 || r < 48 || r != '.' || r != '/' + }) if strings.Index(res, "/") == -1 { // TODO: ipv6 res += "/32"