aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/nat/natupnp.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-06-10 03:12:25 +0800
committerobscuren <geffobscura@gmail.com>2015-06-10 03:12:25 +0800
commitbac9a94ddf20dc530966cbf6cd384aaf94aedc77 (patch)
tree0ced967e60315698cc5056a984d7678c417bc1ce /p2p/nat/natupnp.go
parent0e703d92ac9df61e2ededa8c895c70ded101a607 (diff)
parent14994fa21bf6f05554ff370d41005d06b68d20a5 (diff)
downloaddexon-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.tar.gz
dexon-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.tar.zst
dexon-bac9a94ddf20dc530966cbf6cd384aaf94aedc77.zip
Merge branch 'release/0.9.28'
Diffstat (limited to 'p2p/nat/natupnp.go')
-rw-r--r--p2p/nat/natupnp.go3
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