mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 07:12:27 +00: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 {
|
if err != nil {
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
req.Close = true
|
||||||
req.Header.Set("Content-Type", `text/xml; charset="utf-8"`)
|
req.Header.Set("Content-Type", `text/xml; charset="utf-8"`)
|
||||||
req.Header.Set("User-Agent", "syncthing/1.0")
|
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
|
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)
|
r, err := http.DefaultClient.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if debug {
|
||||||
|
l.Debugln(err)
|
||||||
|
}
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user