mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
Merge pull request #1708 from jarlebring/upnp_close_conn_fix
Fix to for routers that cannot handle many open HTTP-connections
This commit is contained in:
commit
fd4ea46fd7
@ -452,6 +452,7 @@ func soapRequest(url, service, function, message string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
req.Close = true
|
||||
req.Header.Set("Content-Type", `text/xml; charset="utf-8"`)
|
||||
req.Header.Set("User-Agent", "syncthing/1.0")
|
||||
req.Header["SOAPAction"] = []string{fmt.Sprintf(`"%s#%s"`, service, function)} // Enforce capitalization in header-entry for sensitive routers. See issue #1696
|
||||
@ -467,6 +468,9 @@ func soapRequest(url, service, function, message string) ([]byte, error) {
|
||||
|
||||
r, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
if debug {
|
||||
l.Debugln(err)
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user