aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-05 06:55:39 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-05 06:55:39 +0800
commit067e66b34869402cf7bd0f352dad37bd4200e976 (patch)
tree6576ad0110b364685dfd3ef71b3e8019226c35e8 /Godeps
parent8b4605c336568065ea1d2fa1298c3a8489f9bf9e (diff)
parentfc6a5ae3ec7990d5c78649b0af46c46f31b88040 (diff)
downloadgo-tangerine-067e66b34869402cf7bd0f352dad37bd4200e976.tar.gz
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 'Godeps')
-rw-r--r--Godeps/Godeps.json2
-rw-r--r--Godeps/_workspace/src/github.com/huin/goupnp/goupnp.go9
2 files changed, 7 insertions, 4 deletions
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index bc049d1aa..4cbc73def 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -31,7 +31,7 @@
},
{
"ImportPath": "github.com/huin/goupnp",
- "Rev": "c57ae84388ab59076fd547f1abeab71c2edb0a21"
+ "Rev": "5cff77a69fb22f5f1774c4451ea2aab63d4d2f20"
},
{
"ImportPath": "github.com/jackpal/go-nat-pmp",
diff --git a/Godeps/_workspace/src/github.com/huin/goupnp/goupnp.go b/Godeps/_workspace/src/github.com/huin/goupnp/goupnp.go
index 8cd20c2f4..7799a32ce 100644
--- a/Godeps/_workspace/src/github.com/huin/goupnp/goupnp.go
+++ b/Godeps/_workspace/src/github.com/huin/goupnp/goupnp.go
@@ -19,7 +19,7 @@ import (
"fmt"
"net/http"
"net/url"
-
+ "time"
"golang.org/x/net/html/charset"
"github.com/huin/goupnp/httpu"
@@ -64,7 +64,6 @@ func DiscoverDevices(searchTarget string) ([]MaybeRootDevice, error) {
maybe := &results[i]
loc, err := response.Location()
if err != nil {
-
maybe.Err = ContextError{"unexpected bad location from search", err}
continue
}
@@ -93,7 +92,11 @@ func DiscoverDevices(searchTarget string) ([]MaybeRootDevice, error) {
}
func requestXml(url string, defaultSpace string, doc interface{}) error {
- resp, err := http.Get(url)
+ timeout := time.Duration(3 * time.Second)
+ client := http.Client{
+ Timeout: timeout,
+ }
+ resp, err := client.Get(url)
if err != nil {
return err
}