mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
Don't stop discovery on send errors (fixes #240)
This commit is contained in:
parent
8fe546c4a2
commit
7745ed34d3
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user