mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-18 19:15:19 +00:00
Merge pull request #2574 from wkennington/master.upnp
upnp: Use a separate error for the error unmarshalling
This commit is contained in:
commit
f4642e9e66
@ -531,9 +531,9 @@ func (s *IGDService) AddPortMapping(localIPAddress string, protocol Protocol, ex
|
|||||||
if err != nil && timeout > 0 {
|
if err != nil && timeout > 0 {
|
||||||
// Try to repair error code 725 - OnlyPermanentLeasesSupported
|
// Try to repair error code 725 - OnlyPermanentLeasesSupported
|
||||||
envelope := &soapErrorResponse{}
|
envelope := &soapErrorResponse{}
|
||||||
err = xml.Unmarshal(response, envelope)
|
err2 := xml.Unmarshal(response, envelope)
|
||||||
if err != nil {
|
if err2 != nil {
|
||||||
return err
|
return err2
|
||||||
}
|
}
|
||||||
if envelope.ErrorCode == 725 {
|
if envelope.ErrorCode == 725 {
|
||||||
return s.AddPortMapping(localIPAddress, protocol, externalPort, internalPort, description, 0)
|
return s.AddPortMapping(localIPAddress, protocol, externalPort, internalPort, description, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user