mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
Be lenient towards malformed UPnP IGD UUIDs (fixes #890)
This commit is contained in:
parent
3f842221f7
commit
198cbacc3e
@ -636,7 +636,7 @@ nextBlock:
|
|||||||
continue nextBlock
|
continue nextBlock
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select the least busy device to pull the block frop.model. If we found no
|
// Select the least busy device to pull the block from. If we found no
|
||||||
// feasible device at all, fail the block (and in the long run, the
|
// feasible device at all, fail the block (and in the long run, the
|
||||||
// file).
|
// file).
|
||||||
potentialDevices := p.model.availability(p.folder, state.file.Name)
|
potentialDevices := p.model.availability(p.folder, state.file.Name)
|
||||||
|
@ -236,8 +236,7 @@ func handleSearchResponse(deviceType string, knownDevices []*IGD, resp []byte, l
|
|||||||
deviceUUID := strings.TrimLeft(strings.Split(deviceUSN, "::")[0], "uuid:")
|
deviceUUID := strings.TrimLeft(strings.Split(deviceUSN, "::")[0], "uuid:")
|
||||||
matched, err := regexp.MatchString("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", deviceUUID)
|
matched, err := regexp.MatchString("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", deviceUUID)
|
||||||
if !matched {
|
if !matched {
|
||||||
l.Infoln("Invalid IGD response: invalid device UUID " + deviceUUID)
|
l.Infoln("Invalid IGD response: invalid device UUID", deviceUUID, "(continuing anyway)")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't re-add devices that are already known
|
// Don't re-add devices that are already known
|
||||||
|
Loading…
x
Reference in New Issue
Block a user