aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-10-30 07:14:15 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-10-30 07:14:15 +0800
commit1abbe05e933ecdee7e3d1bf286745425e6a474f4 (patch)
tree69073046c5ef6900f88284b16ac716ec64a1e34b /p2p
parentfc46cf337af614f4f9c96acd222089652fe7c76e (diff)
parentf570b68ed107d5e835a71cf1194e2b82c496a387 (diff)
downloadgo-tangerine-1abbe05e933ecdee7e3d1bf286745425e6a474f4.tar
go-tangerine-1abbe05e933ecdee7e3d1bf286745425e6a474f4.tar.gz
go-tangerine-1abbe05e933ecdee7e3d1bf286745425e6a474f4.tar.bz2
go-tangerine-1abbe05e933ecdee7e3d1bf286745425e6a474f4.tar.lz
go-tangerine-1abbe05e933ecdee7e3d1bf286745425e6a474f4.tar.xz
go-tangerine-1abbe05e933ecdee7e3d1bf286745425e6a474f4.tar.zst
go-tangerine-1abbe05e933ecdee7e3d1bf286745425e6a474f4.zip
Merge pull request #1951 from fjl/godeps-upgrade-goupnp
Godeps: upgrade github.com/huin/goupnp
Diffstat (limited to 'p2p')
-rw-r--r--p2p/nat/natupnp.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/p2p/nat/natupnp.go b/p2p/nat/natupnp.go
index 0bcb262bf..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 {
@@ -148,7 +151,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 {