From bf11a47f22311a21639fa4f7794a41cf2f9b809e Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 29 Oct 2015 22:53:53 +0100 Subject: Godeps: upgrade github.com/huin/goupnp to 90f71cb5 --- p2p/nat/natupnp.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'p2p') diff --git a/p2p/nat/natupnp.go b/p2p/nat/natupnp.go index 0bcb262bf..c544fbcb6 100644 --- a/p2p/nat/natupnp.go +++ b/p2p/nat/natupnp.go @@ -148,7 +148,12 @@ func discover(out chan<- *upnp, target string, matcher func(*goupnp.RootDevice, return } // check for a matching IGD service - sc := goupnp.ServiceClient{service.NewSOAPClient(), devs[i].Root, service} + sc := goupnp.ServiceClient{ + SOAPClient: service.NewSOAPClient(), + RootDevice: devs[i].Root, + Location: devs[i].Location, + Service: service, + } sc.SOAPClient.HTTPClient.Timeout = soapRequestTimeout upnp := matcher(devs[i].Root, sc) if upnp == nil { -- cgit v1.2.3 From f570b68ed107d5e835a71cf1194e2b82c496a387 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 29 Oct 2015 22:54:44 +0100 Subject: p2p/nat: add docs for discover --- p2p/nat/natupnp.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'p2p') diff --git a/p2p/nat/natupnp.go b/p2p/nat/natupnp.go index c544fbcb6..890a35043 100644 --- a/p2p/nat/natupnp.go +++ b/p2p/nat/natupnp.go @@ -133,6 +133,9 @@ func discoverUPnP() Interface { return nil } +// finds devices matching the given target and calls matcher for all +// advertised services of each device. The first non-nil service found +// is sent into out. If no service matched, nil is sent. func discover(out chan<- *upnp, target string, matcher func(*goupnp.RootDevice, goupnp.ServiceClient) *upnp) { devs, err := goupnp.DiscoverDevices(target) if err != nil { -- cgit v1.2.3