miniupnpc.c: MX cannot be 0

This commit is contained in:
Thomas Bernard 2013-02-20 17:08:07 +01:00
parent 91602e129d
commit 3e885191c0
1 changed files with 4 additions and 0 deletions

View File

@ -533,6 +533,10 @@ upnpDiscoverDevices(const char * const deviceTypes[],
*error = UPNPDISCOVER_SUCCESS; *error = UPNPDISCOVER_SUCCESS;
/* Calculating maximum response time in seconds */ /* Calculating maximum response time in seconds */
mx = ((unsigned int)delay) / 1000u; mx = ((unsigned int)delay) / 1000u;
if(mx == 0) {
mx = 1;
delay = 1000;
}
/* receiving SSDP response packet */ /* receiving SSDP response packet */
for(deviceIndex = 0; deviceTypes[deviceIndex]; deviceIndex++) { for(deviceIndex = 0; deviceTypes[deviceIndex]; deviceIndex++) {
/* sending the SSDP M-SEARCH packet */ /* sending the SSDP M-SEARCH packet */