White spaces.

This commit is contained in:
Marcelo Roberto Jimenez 2010-12-19 21:19:44 -02:00
parent 2ce88f80f0
commit 6af93e6ca6

View File

@ -416,9 +416,8 @@ static void searchExpired(
} }
HandleUnlock(); HandleUnlock();
if (found) { if (found)
ctrlpt_callback(UPNP_DISCOVERY_SEARCH_TIMEOUT, NULL, cookie); ctrlpt_callback(UPNP_DISCOVERY_SEARCH_TIMEOUT, NULL, cookie);
}
free(id); free(id);
} }
@ -448,24 +447,18 @@ int SearchByTarget(int Mx, char *St, void *Cookie)
ThreadPoolJob job; ThreadPoolJob job;
requestType = ssdp_request_type1(St); requestType = ssdp_request_type1(St);
if (requestType == SSDP_SERROR) { if (requestType == SSDP_SERROR)
return UPNP_E_INVALID_PARAM; return UPNP_E_INVALID_PARAM;
}
UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__, UpnpPrintf(UPNP_INFO, SSDP, __FILE__, __LINE__,
"Inside SearchByTarget\n"); "Inside SearchByTarget\n");
timeTillRead = Mx; timeTillRead = Mx;
if (timeTillRead < MIN_SEARCH_TIME) { if (timeTillRead < MIN_SEARCH_TIME)
timeTillRead = MIN_SEARCH_TIME; timeTillRead = MIN_SEARCH_TIME;
} else if (timeTillRead > MAX_SEARCH_TIME) { else if (timeTillRead > MAX_SEARCH_TIME)
timeTillRead = MAX_SEARCH_TIME; timeTillRead = MAX_SEARCH_TIME;
}
CreateClientRequestPacket(ReqBufv4, timeTillRead, St, AF_INET); CreateClientRequestPacket(ReqBufv4, timeTillRead, St, AF_INET);
CreateClientRequestPacket(ReqBufv6, timeTillRead, St, AF_INET6); CreateClientRequestPacket(ReqBufv6, timeTillRead, St, AF_INET6);
CreateClientRequestPacketUlaGua(ReqBufv6UlaGua, timeTillRead, St, CreateClientRequestPacketUlaGua(ReqBufv6UlaGua, timeTillRead, St, AF_INET6);
AF_INET6);
memset(&__ss_v4, 0, sizeof(__ss_v4)); memset(&__ss_v4, 0, sizeof(__ss_v4));
destAddr4->sin_family = AF_INET; destAddr4->sin_family = AF_INET;
@ -482,25 +475,20 @@ int SearchByTarget(int Mx, char *St, void *Cookie)
HandleLock(); HandleLock();
if (GetClientHandleInfo(&handle, &ctrlpt_info) != HND_CLIENT) { if (GetClientHandleInfo(&handle, &ctrlpt_info) != HND_CLIENT) {
HandleUnlock(); HandleUnlock();
return UPNP_E_INTERNAL_ERROR; return UPNP_E_INTERNAL_ERROR;
} }
newArg = (SsdpSearchArg *) malloc(sizeof(SsdpSearchArg)); newArg = (SsdpSearchArg *) malloc(sizeof(SsdpSearchArg));
newArg->searchTarget = strdup(St); newArg->searchTarget = strdup(St);
newArg->cookie = Cookie; newArg->cookie = Cookie;
newArg->requestType = requestType; newArg->requestType = requestType;
id = (int *)malloc(sizeof(int)); id = (int *)malloc(sizeof(int));
TPJobInit(&job, (start_routine) searchExpired, id); TPJobInit(&job, (start_routine) searchExpired, id);
TPJobSetPriority(&job, MED_PRIORITY); TPJobSetPriority(&job, MED_PRIORITY);
TPJobSetFreeFunction(&job, (free_routine) free); TPJobSetFreeFunction(&job, (free_routine) free);
/* Schedule a timeout event to remove search Arg */ /* Schedule a timeout event to remove search Arg */
TimerThreadSchedule(&gTimerThread, timeTillRead, TimerThreadSchedule(&gTimerThread, timeTillRead,
REL_SEC, &job, SHORT_TERM, id); REL_SEC, &job, SHORT_TERM, id);
newArg->timeoutEventId = *id; newArg->timeoutEventId = *id;
ListAddTail(&ctrlpt_info->SsdpSearchList, newArg); ListAddTail(&ctrlpt_info->SsdpSearchList, newArg);
HandleUnlock(); HandleUnlock();
/* End of lock */ /* End of lock */
@ -520,7 +508,6 @@ int SearchByTarget(int Mx, char *St, void *Cookie)
max_fd = max(max_fd, gSsdpReqSocket6); max_fd = max(max_fd, gSsdpReqSocket6);
} }
#endif #endif
ret = select(max_fd + 1, NULL, &wrSet, NULL, NULL); ret = select(max_fd + 1, NULL, &wrSet, NULL, NULL);
if (ret == -1) { if (ret == -1) {
strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN); strerror_r(errno, errorBuffer, ERROR_BUFFER_LEN);
@ -561,8 +548,7 @@ int SearchByTarget(int Mx, char *St, void *Cookie)
imillisleep(SSDP_PAUSE); imillisleep(SSDP_PAUSE);
} }
} }
#endif /* IPv6 */ #endif /* IPv6 */
if (gSsdpReqSocket4 != INVALID_SOCKET && if (gSsdpReqSocket4 != INVALID_SOCKET &&
FD_ISSET(gSsdpReqSocket4, &wrSet)) { FD_ISSET(gSsdpReqSocket4, &wrSet)) {
int NumCopy = 0; int NumCopy = 0;