mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-05 16:12:20 +00:00
Better trace output from mc
This commit is contained in:
parent
dcd7d278aa
commit
f398ca77c1
14
mc/beacon.go
14
mc/beacon.go
@ -45,6 +45,9 @@ func (b *Beacon) run() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
if debug {
|
||||||
|
dlog.Printf("trying %d interfaces", len(intfs))
|
||||||
|
}
|
||||||
|
|
||||||
for _, intf := range intfs {
|
for _, intf := range intfs {
|
||||||
intf := intf
|
intf := intf
|
||||||
@ -55,10 +58,13 @@ func (b *Beacon) run() {
|
|||||||
conn, err := net.ListenMulticastUDP("udp4", &intf, group)
|
conn, err := net.ListenMulticastUDP("udp4", &intf, group)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if debug {
|
if debug {
|
||||||
dlog.Printf("listen for multicast group on %q: %v", intf.Name, err)
|
dlog.Printf("failed to listen for multicast group on %q: %v", intf.Name, err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
b.conns = append(b.conns, conn)
|
b.conns = append(b.conns, conn)
|
||||||
|
if debug {
|
||||||
|
dlog.Printf("listening for multicast group on %q", intf.Name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,6 +78,9 @@ func (b *Beacon) run() {
|
|||||||
dlog.Println(err)
|
dlog.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if debug {
|
||||||
|
dlog.Printf("recv %d bytes from %s on %v", n, addr, conn)
|
||||||
|
}
|
||||||
b.outbox <- recv{bs[:n], addr}
|
b.outbox <- recv{bs[:n], addr}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@ -85,6 +94,9 @@ func (b *Beacon) run() {
|
|||||||
dlog.Println(err)
|
dlog.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if debug {
|
||||||
|
dlog.Printf("sent %d bytes to %s on %v", len(bs), group, conn)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Loading…
Reference in New Issue
Block a user