From 606fce09ca4dc06fc91302d0e811926e4196acbe Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Mon, 21 Aug 2017 10:03:25 +0000 Subject: [PATCH] lib/upnp: Disable confusing messages GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4312 --- lib/upnp/upnp.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/upnp/upnp.go b/lib/upnp/upnp.go index e72132d6a..2297737c9 100644 --- a/lib/upnp/upnp.go +++ b/lib/upnp/upnp.go @@ -168,7 +168,9 @@ USER-AGENT: syncthing/1.0 _, err = socket.WriteTo(search, ssdp) if err != nil { - l.Infoln(err) + if e, ok := err.(net.Error); !ok || !e.Timeout() { + l.Infoln(err) + } return } @@ -226,11 +228,6 @@ func parseResponse(deviceType string, resp []byte) (IGD, error) { } deviceUUID := strings.TrimPrefix(strings.Split(deviceUSN, "::")[0], "uuid:") - matched, _ := regexp.MatchString("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", deviceUUID) - if !matched { - l.Infoln("Invalid IGD response: invalid device UUID", deviceUUID, "(continuing anyway)") - } - response, err = http.Get(deviceDescriptionLocation) if err != nil { return IGD{}, err