diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-05 06:55:39 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-05 06:55:39 +0800 |
commit | 067e66b34869402cf7bd0f352dad37bd4200e976 (patch) | |
tree | 6576ad0110b364685dfd3ef71b3e8019226c35e8 /p2p/nat | |
parent | 8b4605c336568065ea1d2fa1298c3a8489f9bf9e (diff) | |
parent | fc6a5ae3ec7990d5c78649b0af46c46f31b88040 (diff) | |
download | go-tangerine-067e66b34869402cf7bd0f352dad37bd4200e976.tar go-tangerine-067e66b34869402cf7bd0f352dad37bd4200e976.tar.gz go-tangerine-067e66b34869402cf7bd0f352dad37bd4200e976.tar.bz2 go-tangerine-067e66b34869402cf7bd0f352dad37bd4200e976.tar.lz go-tangerine-067e66b34869402cf7bd0f352dad37bd4200e976.tar.xz go-tangerine-067e66b34869402cf7bd0f352dad37bd4200e976.tar.zst go-tangerine-067e66b34869402cf7bd0f352dad37bd4200e976.zip |
Merge pull request #1185 from fjl/p2p-nat-timeouts
p2p/nat: request timeouts for UPnP discovery
Diffstat (limited to 'p2p/nat')
-rw-r--r-- | p2p/nat/natupnp.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/p2p/nat/natupnp.go b/p2p/nat/natupnp.go index ef7765e8d..21a9cf8b1 100644 --- a/p2p/nat/natupnp.go +++ b/p2p/nat/natupnp.go @@ -12,6 +12,8 @@ import ( "github.com/huin/goupnp/dcps/internetgateway2" ) +const soapRequestTimeout = 3 * time.Second + type upnp struct { dev *goupnp.RootDevice service string @@ -131,6 +133,7 @@ func discover(out chan<- *upnp, target string, matcher func(*goupnp.RootDevice, } // check for a matching IGD service sc := goupnp.ServiceClient{service.NewSOAPClient(), devs[i].Root, service} + sc.SOAPClient.HTTPClient.Timeout = soapRequestTimeout upnp := matcher(devs[i].Root, sc) if upnp == nil { return |