lib/connections: Consistent log levels & polish (fixes #4510)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4511
This commit is contained in:
Simon Frei
2017-11-14 21:49:36 +00:00
committed by Audrius Butkevicius
parent fa12a18190
commit 4efff736b3
8 changed files with 31 additions and 30 deletions

View File

@@ -152,14 +152,14 @@ USER-AGENT: syncthing/1.0
socket, err := net.ListenMulticastUDP("udp4", intf, &net.UDPAddr{IP: ssdp.IP})
if err != nil {
l.Debugln(err)
l.Debugln("UPnP discovery: listening to udp multicast:", err)
return
}
defer socket.Close() // Make sure our socket gets closed
err = socket.SetDeadline(time.Now().Add(timeout))
if err != nil {
l.Infoln(err)
l.Debugln("UPnP discovery: setting socket deadline:", err)
return
}
@@ -168,7 +168,7 @@ USER-AGENT: syncthing/1.0
_, err = socket.WriteTo(search, ssdp)
if err != nil {
if e, ok := err.(net.Error); !ok || !e.Timeout() {
l.Infoln(err)
l.Debugln("UPnP discovery: sending search request:", err)
}
return
}
@@ -424,7 +424,7 @@ func soapRequest(url, service, function, message string) ([]byte, error) {
r, err := http.DefaultClient.Do(req)
if err != nil {
l.Debugln(err)
l.Debugln("SOAP do:", err)
return resp, err
}