Be lenient towards malformed UPnP IGD UUIDs (fixes #890)

This commit is contained in:
Jakob Borg 2014-10-21 13:12:57 +02:00
parent 3f842221f7
commit 198cbacc3e
2 changed files with 4 additions and 5 deletions

View File

@ -636,7 +636,7 @@ 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
// file).
potentialDevices := p.model.availability(p.folder, state.file.Name)

View File

@ -236,8 +236,7 @@ func handleSearchResponse(deviceType string, knownDevices []*IGD, resp []byte, l
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)
if !matched {
l.Infoln("Invalid IGD response: invalid device UUID " + deviceUUID)
return
l.Infoln("Invalid IGD response: invalid device UUID", deviceUUID, "(continuing anyway)")
}
// Don't re-add devices that are already known