Don't stop discovery on send errors (fixes #240)

This commit is contained in:
Jakob Borg 2014-05-28 07:03:47 +02:00
parent 8fe546c4a2
commit 7745ed34d3
2 changed files with 2 additions and 10 deletions

View File

@ -102,9 +102,7 @@ func (b *Beacon) writer() {
if debug { if debug {
l.Debugln(err) l.Debugln(err)
} }
return } else if debug {
}
if debug {
l.Debugf("sent %d bytes to %s", len(bs), dst) l.Debugf("sent %d bytes to %s", len(bs), dst)
} }
} }

View File

@ -187,9 +187,8 @@ func (d *Discoverer) sendExternalAnnouncements() {
} else { } else {
buf = d.announcementPkt() buf = d.announcementPkt()
} }
var errCounter = 0
for errCounter < maxErrors { for {
var ok bool var ok bool
if debug { if debug {
@ -201,11 +200,8 @@ func (d *Discoverer) sendExternalAnnouncements() {
if debug { if debug {
l.Debugln("discover: warning:", err) l.Debugln("discover: warning:", err)
} }
errCounter++
ok = false ok = false
} else { } else {
errCounter = 0
// Verify that the announce server responds positively for our node ID // Verify that the announce server responds positively for our node ID
time.Sleep(1 * time.Second) time.Sleep(1 * time.Second)
@ -214,7 +210,6 @@ func (d *Discoverer) sendExternalAnnouncements() {
l.Debugln("discover: external lookup check:", res) l.Debugln("discover: external lookup check:", res)
} }
ok = len(res) > 0 ok = len(res) > 0
} }
d.extAnnounceOKmut.Lock() d.extAnnounceOKmut.Lock()
@ -227,7 +222,6 @@ func (d *Discoverer) sendExternalAnnouncements() {
time.Sleep(60 * time.Second) time.Sleep(60 * time.Second)
} }
} }
l.Warnf("Global discovery: %v: stopping due to too many errors: %v", remote, err)
} }
func (d *Discoverer) recvAnnouncements() { func (d *Discoverer) recvAnnouncements() {