miniupnpc.c: reindent upnpDiscover()

This commit is contained in:
Thomas Bernard 2013-02-20 16:29:28 +01:00
parent 2b9c014394
commit 09d5473c54
1 changed files with 144 additions and 149 deletions

View File

@ -536,10 +536,8 @@ upnpDiscoverDevices(const char * const deviceTypes[],
/* Calculating maximum response time in seconds */
mx = ((unsigned int)delay) / 1000u;
/* receiving SSDP response packet */
for(n = 0; deviceTypes[deviceIndex]; deviceIndex++)
{
if(n == 0)
{
for(n = 0; deviceTypes[deviceIndex]; deviceIndex++) {
if(n == 0) {
/* sending the SSDP M-SEARCH packet */
n = snprintf(bufr, sizeof(bufr),
MSearchMsgFmt,
@ -554,7 +552,6 @@ upnpDiscoverDevices(const char * const deviceTypes[],
(linklocal ? "[" UPNP_MCAST_LL_ADDR "]" : "[" UPNP_MCAST_SL_ADDR "]")
: UPNP_MCAST_ADDR,
deviceTypes[deviceIndex]);
#endif
#ifdef NO_GETADDRINFO
/* the following code is not using getaddrinfo */
@ -573,8 +570,7 @@ upnpDiscoverDevices(const char * const deviceTypes[],
p->sin_port = htons(PORT);
p->sin_addr.s_addr = inet_addr(UPNP_MCAST_ADDR);
}
n = sendto(sudp, bufr, n, 0,
&sockudp_w,
n = sendto(sudp, bufr, n, 0, &sockudp_w,
ipv6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in));
if (n < 0) {
if(error)
@ -655,8 +651,7 @@ upnpDiscoverDevices(const char * const deviceTypes[],
int stsize=0;
/*printf("%d byte(s) :\n%s\n", n, bufr);*/ /* affichage du message */
parseMSEARCHReply(bufr, n, &descURL, &urlsize, &st, &stsize);
if(st&&descURL)
{
if(st&&descURL) {
#ifdef DEBUG
printf("M-SEARCH Reply:\n ST: %.*s\n Location: %.*s\n",
stsize, st, urlsize, descURL);