Loading ares/ares_init.c +12 −8 Original line number Diff line number Diff line Loading @@ -1383,25 +1383,29 @@ static const char *try_option(const char *p, const char *q, const char *opt) static char *try_config(char *s, const char *opt) { size_t len; ssize_t i; ssize_t j; char *p; char *q; if (!s || !opt) /* no line or no option */ return NULL; /* trim line comment */ for (i = 0; s[i] && s[i] != '#'; ++i); s[i] = '\0'; p = s; while (*p && (*p != '#')) p++; *p = '\0'; /* trim trailing whitespace */ for (j = i-1; j >= 0 && ISSPACE(s[j]); --j); s[++j] = '\0'; q = p - 1; while ((q >= s) && ISSPACE(*q)) q--; *++q = '\0'; /* skip leading whitespace */ for (i = 0; s[i] && ISSPACE(s[i]); ++i); p = &s[i]; p = s; while (*p && ISSPACE(*p)) p++; if (!*p) /* empty line */ Loading tests/libtest/lib540.c +5 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ static int loop(CURLM *cm, const char* url, const char* userpwd, struct curl_slist *headers) { CURLMsg *msg; CURLMcode code; long L; int M, Q, U = -1; fd_set R, W, E; Loading @@ -52,7 +53,10 @@ static int loop(CURLM *cm, const char* url, const char* userpwd, init(cm, url, userpwd, headers); while (U) { while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(cm, &U)); do { code = curl_multi_perform(cm, &U); } while (code == CURLM_CALL_MULTI_PERFORM); if (U) { FD_ZERO(&R); Loading tests/libtest/lib560.c +7 −4 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ int test(char *URL) { CURL *http_handle; CURLM *multi_handle; CURLMcode code; int still_running; /* keep number of running handles */ Loading @@ -48,8 +49,9 @@ int test(char *URL) curl_multi_add_handle(multi_handle, http_handle); /* we start some action by calling perform right away */ while(CURLM_CALL_MULTI_PERFORM == curl_multi_perform(multi_handle, &still_running)); do { code = curl_multi_perform(multi_handle, &still_running); } while(code == CURLM_CALL_MULTI_PERFORM); while(still_running) { struct timeval timeout; Loading Loading @@ -84,8 +86,9 @@ int test(char *URL) case 0: default: /* timeout or readable/writable sockets */ while(CURLM_CALL_MULTI_PERFORM == curl_multi_perform(multi_handle, &still_running)); do { code = curl_multi_perform(multi_handle, &still_running); } while(code == CURLM_CALL_MULTI_PERFORM); break; } } Loading tests/server/sockfilt.c +4 −1 Original line number Diff line number Diff line Loading @@ -837,6 +837,7 @@ int main(int argc, char *argv[]) curl_socket_t msgsock = CURL_SOCKET_BAD; int wrotepidfile = 0; char *pidname= (char *)".sockfilt.pid"; bool juggle_again; int rc; int error; int arg=1; Loading Loading @@ -1001,7 +1002,9 @@ int main(int argc, char *argv[]) if(!wrotepidfile) goto sockfilt_cleanup; while(juggle(&msgsock, sock, &mode)); do { juggle_again = juggle(&msgsock, sock, &mode); } while(juggle_again); sockfilt_cleanup: Loading Loading
ares/ares_init.c +12 −8 Original line number Diff line number Diff line Loading @@ -1383,25 +1383,29 @@ static const char *try_option(const char *p, const char *q, const char *opt) static char *try_config(char *s, const char *opt) { size_t len; ssize_t i; ssize_t j; char *p; char *q; if (!s || !opt) /* no line or no option */ return NULL; /* trim line comment */ for (i = 0; s[i] && s[i] != '#'; ++i); s[i] = '\0'; p = s; while (*p && (*p != '#')) p++; *p = '\0'; /* trim trailing whitespace */ for (j = i-1; j >= 0 && ISSPACE(s[j]); --j); s[++j] = '\0'; q = p - 1; while ((q >= s) && ISSPACE(*q)) q--; *++q = '\0'; /* skip leading whitespace */ for (i = 0; s[i] && ISSPACE(s[i]); ++i); p = &s[i]; p = s; while (*p && ISSPACE(*p)) p++; if (!*p) /* empty line */ Loading
tests/libtest/lib540.c +5 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ static int loop(CURLM *cm, const char* url, const char* userpwd, struct curl_slist *headers) { CURLMsg *msg; CURLMcode code; long L; int M, Q, U = -1; fd_set R, W, E; Loading @@ -52,7 +53,10 @@ static int loop(CURLM *cm, const char* url, const char* userpwd, init(cm, url, userpwd, headers); while (U) { while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(cm, &U)); do { code = curl_multi_perform(cm, &U); } while (code == CURLM_CALL_MULTI_PERFORM); if (U) { FD_ZERO(&R); Loading
tests/libtest/lib560.c +7 −4 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ int test(char *URL) { CURL *http_handle; CURLM *multi_handle; CURLMcode code; int still_running; /* keep number of running handles */ Loading @@ -48,8 +49,9 @@ int test(char *URL) curl_multi_add_handle(multi_handle, http_handle); /* we start some action by calling perform right away */ while(CURLM_CALL_MULTI_PERFORM == curl_multi_perform(multi_handle, &still_running)); do { code = curl_multi_perform(multi_handle, &still_running); } while(code == CURLM_CALL_MULTI_PERFORM); while(still_running) { struct timeval timeout; Loading Loading @@ -84,8 +86,9 @@ int test(char *URL) case 0: default: /* timeout or readable/writable sockets */ while(CURLM_CALL_MULTI_PERFORM == curl_multi_perform(multi_handle, &still_running)); do { code = curl_multi_perform(multi_handle, &still_running); } while(code == CURLM_CALL_MULTI_PERFORM); break; } } Loading
tests/server/sockfilt.c +4 −1 Original line number Diff line number Diff line Loading @@ -837,6 +837,7 @@ int main(int argc, char *argv[]) curl_socket_t msgsock = CURL_SOCKET_BAD; int wrotepidfile = 0; char *pidname= (char *)".sockfilt.pid"; bool juggle_again; int rc; int error; int arg=1; Loading Loading @@ -1001,7 +1002,9 @@ int main(int argc, char *argv[]) if(!wrotepidfile) goto sockfilt_cleanup; while(juggle(&msgsock, sock, &mode)); do { juggle_again = juggle(&msgsock, sock, &mode); } while(juggle_again); sockfilt_cleanup: Loading