mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 13:00:47 +00:00
commit
f1e9837a98
@ -191,7 +191,9 @@ func (m *Multicast) getAllowedInterfaces() map[string]net.Interface {
|
|||||||
// Ask the system for network interfaces
|
// Ask the system for network interfaces
|
||||||
allifaces, err := net.Interfaces()
|
allifaces, err := net.Interfaces()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
// Don't panic, since this may be from e.g. too many open files (from too much connection spam)
|
||||||
|
// TODO? log something
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
// Work out which interfaces to announce on
|
// Work out which interfaces to announce on
|
||||||
for _, iface := range allifaces {
|
for _, iface := range allifaces {
|
||||||
|
@ -226,7 +226,13 @@ func (t *tcp) listener(l *TcpListener, listenaddr string) {
|
|||||||
sock, err := l.Listener.Accept()
|
sock, err := l.Listener.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.links.core.log.Errorln("Failed to accept connection:", err)
|
t.links.core.log.Errorln("Failed to accept connection:", err)
|
||||||
|
select {
|
||||||
|
case <-l.stop:
|
||||||
return
|
return
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
time.Sleep(time.Second) // So we don't busy loop
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
t.waitgroup.Add(1)
|
t.waitgroup.Add(1)
|
||||||
options := tcpOptions{
|
options := tcpOptions{
|
||||||
|
Loading…
Reference in New Issue
Block a user