mirror of
https://github.com/curl/curl.git
synced 2026-08-05 22:06:15 +03:00
checksrc: warn for assignments within if() expressions
... they're already frowned upon in our source code style guide, this now enforces the rule harder.
This commit is contained in:
parent
b228d2952b
commit
1c3e8bbfed
86 changed files with 413 additions and 226 deletions
|
|
@ -136,7 +136,8 @@ int test(char *URL)
|
|||
"http://testserver.example.com:%s/%s%04d", port, path, i);
|
||||
|
||||
/* second request must succeed like the first one */
|
||||
if((res = do_one_request(multi, target_url, dns_entry)))
|
||||
res = do_one_request(multi, target_url, dns_entry);
|
||||
if(res)
|
||||
goto test_cleanup;
|
||||
|
||||
if(i < count)
|
||||
|
|
|
|||
|
|
@ -81,7 +81,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -36,7 +36,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -46,7 +46,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -136,7 +136,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(curl == NULL) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -195,7 +195,8 @@ int test(char *URL)
|
|||
|
||||
/* prepare share */
|
||||
printf("SHARE_INIT\n");
|
||||
if((share = curl_share_init()) == NULL) {
|
||||
share = curl_share_init();
|
||||
if(!share) {
|
||||
fprintf(stderr, "curl_share_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
@ -230,7 +231,8 @@ int test(char *URL)
|
|||
}
|
||||
|
||||
/* initial cookie manipulation */
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_share_cleanup(share);
|
||||
curl_global_cleanup();
|
||||
|
|
@ -275,7 +277,8 @@ int test(char *URL)
|
|||
|
||||
/* fetch a another one and save cookies */
|
||||
printf("*** run %d\n", i);
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_share_cleanup(share);
|
||||
curl_global_cleanup();
|
||||
|
|
@ -302,7 +305,8 @@ int test(char *URL)
|
|||
curl_slist_free_all(headers);
|
||||
|
||||
/* load cookies */
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_share_cleanup(share);
|
||||
curl_global_cleanup();
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -489,7 +489,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
close_file_descriptors();
|
||||
curl_global_cleanup();
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -491,7 +491,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
close_file_descriptors();
|
||||
curl_global_cleanup();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,8 @@ int test(char *URL)
|
|||
}
|
||||
|
||||
/* get a curl handle */
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
fclose(hd_src);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ int test(char *URL)
|
|||
}
|
||||
|
||||
/* get a curl handle */
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ int test(char *URL)
|
|||
char *s;
|
||||
(void)URL;
|
||||
|
||||
if((easy = curl_easy_init()) == NULL) {
|
||||
easy = curl_easy_init();
|
||||
if(!easy) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -172,7 +172,8 @@ int test(char *URL)
|
|||
|
||||
config.trace_ascii = 1; /* enable ascii tracing */
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,8 @@ static int once(char *URL, bool oldstyle)
|
|||
if(formrc)
|
||||
printf("curl_formadd(4) = %d\n", (int)formrc);
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_formfree(formpost);
|
||||
curl_global_cleanup();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ int test(char *URL)
|
|||
}
|
||||
|
||||
/* get a curl handle */
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
@ -66,7 +67,8 @@ int test(char *URL)
|
|||
|
||||
test_setopt(curl, CURLOPT_URL, URL);
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -100,7 +102,8 @@ int test(char *URL)
|
|||
sdpf = NULL;
|
||||
|
||||
/* Make sure we can do a normal request now */
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -115,7 +118,8 @@ int test(char *URL)
|
|||
|
||||
/* Now do a POST style one */
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -144,7 +148,8 @@ int test(char *URL)
|
|||
custom_headers = NULL;
|
||||
|
||||
/* Make sure we can do a normal request now */
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
fclose(idfile);
|
||||
|
|
@ -77,7 +78,8 @@ int test(char *URL)
|
|||
|
||||
/* Go through the various Session IDs */
|
||||
for(i = 0; i < 3; i++) {
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -96,7 +98,8 @@ int test(char *URL)
|
|||
fprintf(idfile, "Got Session ID: [%s]\n", rtsp_session_id);
|
||||
rtsp_session_id = NULL;
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
@ -54,7 +55,8 @@ int test(char *URL)
|
|||
|
||||
test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -74,7 +76,8 @@ int test(char *URL)
|
|||
"RAW/RAW/UDP;unicast;client_port=3056-3057");
|
||||
test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -88,7 +91,8 @@ int test(char *URL)
|
|||
|
||||
test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_PLAY);
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
fclose(protofile);
|
||||
curl_global_cleanup();
|
||||
|
|
@ -126,7 +127,8 @@ int test(char *URL)
|
|||
}
|
||||
test_setopt(curl, CURLOPT_URL, URL);
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -147,7 +149,8 @@ int test(char *URL)
|
|||
goto test_cleanup;
|
||||
|
||||
/* This PLAY starts the interleave */
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -161,7 +164,8 @@ int test(char *URL)
|
|||
goto test_cleanup;
|
||||
|
||||
/* The DESCRIBE request will try to consume data after the Content */
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -174,7 +178,8 @@ int test(char *URL)
|
|||
if(res)
|
||||
goto test_cleanup;
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
@ -69,7 +70,8 @@ int test(char *URL)
|
|||
test_setopt(curl, CURLOPT_URL, URL);
|
||||
|
||||
/* SETUP */
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -83,7 +85,8 @@ int test(char *URL)
|
|||
if(res)
|
||||
goto test_cleanup;
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -117,7 +120,8 @@ int test(char *URL)
|
|||
paramsf = NULL;
|
||||
|
||||
/* Heartbeat GET_PARAMETERS */
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -131,7 +135,8 @@ int test(char *URL)
|
|||
|
||||
/* POST GET_PARAMETERS */
|
||||
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
@ -149,7 +154,8 @@ int test(char *URL)
|
|||
test_setopt(curl, CURLOPT_POSTFIELDS, NULL);
|
||||
|
||||
/* Make sure we can do a normal request now */
|
||||
if((stream_uri = suburl(URL, request++)) == NULL) {
|
||||
stream_uri = suburl(URL, request++);
|
||||
if(!stream_uri) {
|
||||
res = TEST_ERR_MAJOR_BAD;
|
||||
goto test_cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ static void *fire(void *ptr)
|
|||
CURL *curl;
|
||||
int i=0;
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -148,7 +149,8 @@ int test(char *URL)
|
|||
|
||||
/* prepare share */
|
||||
printf("SHARE_INIT\n");
|
||||
if((share = curl_share_init()) == NULL) {
|
||||
share = curl_share_init();
|
||||
if(!share) {
|
||||
fprintf(stderr, "curl_share_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
@ -197,7 +199,8 @@ int test(char *URL)
|
|||
|
||||
/* fetch a another one */
|
||||
printf("*** run %d\n", i);
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_share_cleanup(share);
|
||||
curl_global_cleanup();
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ int test(char *URL)
|
|||
return TEST_ERR_MAJOR_BAD;
|
||||
}
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,8 @@ int test(char *url)
|
|||
|
||||
/* Send wrong password, then right password */
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
@ -120,8 +121,8 @@ int test(char *url)
|
|||
curl_easy_cleanup(curl);
|
||||
|
||||
/* Send wrong password twice, then right password */
|
||||
|
||||
if((curl = curl_easy_init()) == NULL) {
|
||||
curl = curl_easy_init();
|
||||
if(!curl) {
|
||||
fprintf(stderr, "curl_easy_init() failed\n");
|
||||
curl_global_cleanup();
|
||||
return TEST_ERR_MAJOR_BAD;
|
||||
|
|
|
|||
|
|
@ -309,7 +309,8 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
ptr++;
|
||||
end = ptr;
|
||||
EAT_WORD(end);
|
||||
if((len.sig = end - ptr) > MAX_TAG_LEN) {
|
||||
len.sig = end - ptr;
|
||||
if(len.sig > MAX_TAG_LEN) {
|
||||
error = GPE_NO_BUFFER_SPACE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -370,7 +371,8 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
/* get potential tag */
|
||||
end = ptr;
|
||||
EAT_WORD(end);
|
||||
if((len.sig = end - ptr) > MAX_TAG_LEN) {
|
||||
len.sig = end - ptr;
|
||||
if(len.sig > MAX_TAG_LEN) {
|
||||
error = GPE_NO_BUFFER_SPACE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -389,7 +391,8 @@ int getpart(char **outbuf, size_t *outlen,
|
|||
end = ptr;
|
||||
while(*end && ('>' != *end))
|
||||
end++;
|
||||
if((len.sig = end - ptr) > MAX_TAG_LEN) {
|
||||
len.sig = end - ptr;
|
||||
if(len.sig > MAX_TAG_LEN) {
|
||||
error = GPE_NO_BUFFER_SPACE;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,36 +260,42 @@ static void install_signal_handlers(void)
|
|||
{
|
||||
#ifdef SIGHUP
|
||||
/* ignore SIGHUP signal */
|
||||
if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR)
|
||||
old_sighup_handler = signal(SIGHUP, SIG_IGN);
|
||||
if(old_sighup_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGHUP handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
/* ignore SIGPIPE signal */
|
||||
if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
|
||||
old_sigpipe_handler = signal(SIGPIPE, SIG_IGN);
|
||||
if(old_sigpipe_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGPIPE handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGALRM
|
||||
/* ignore SIGALRM signal */
|
||||
if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR)
|
||||
old_sigalrm_handler = signal(SIGALRM, SIG_IGN);
|
||||
if(old_sigalrm_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGALRM handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGINT
|
||||
/* handle SIGINT signal with our exit_signal_handler */
|
||||
if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigint_handler = signal(SIGINT, exit_signal_handler);
|
||||
if(old_sigint_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGINT handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGINT, 1);
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
/* handle SIGTERM signal with our exit_signal_handler */
|
||||
if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigterm_handler = signal(SIGTERM, exit_signal_handler);
|
||||
if(old_sigterm_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGTERM handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGTERM, 1);
|
||||
#endif
|
||||
#if defined(SIGBREAK) && defined(WIN32)
|
||||
/* handle SIGBREAK signal with our exit_signal_handler */
|
||||
if((old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler);
|
||||
if(old_sigbreak_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGBREAK handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGBREAK, 1);
|
||||
|
|
|
|||
|
|
@ -206,36 +206,42 @@ static void install_signal_handlers(void)
|
|||
{
|
||||
#ifdef SIGHUP
|
||||
/* ignore SIGHUP signal */
|
||||
if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR)
|
||||
old_sighup_handler = signal(SIGHUP, SIG_IGN);
|
||||
if(old_sighup_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGHUP handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
/* ignore SIGPIPE signal */
|
||||
if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
|
||||
old_sigpipe_handler = signal(SIGPIPE, SIG_IGN);
|
||||
if(old_sigpipe_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGPIPE handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGALRM
|
||||
/* ignore SIGALRM signal */
|
||||
if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR)
|
||||
old_sigalrm_handler = signal(SIGALRM, SIG_IGN);
|
||||
if(old_sigalrm_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGALRM handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGINT
|
||||
/* handle SIGINT signal with our exit_signal_handler */
|
||||
if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigint_handler = signal(SIGINT, exit_signal_handler);
|
||||
if(old_sigint_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGINT handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGINT, 1);
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
/* handle SIGTERM signal with our exit_signal_handler */
|
||||
if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigterm_handler = signal(SIGTERM, exit_signal_handler);
|
||||
if(old_sigterm_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGTERM handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGTERM, 1);
|
||||
#endif
|
||||
#if defined(SIGBREAK) && defined(WIN32)
|
||||
/* handle SIGBREAK signal with our exit_signal_handler */
|
||||
if((old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler);
|
||||
if(old_sigbreak_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGBREAK handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGBREAK, 1);
|
||||
|
|
|
|||
|
|
@ -265,36 +265,42 @@ static void install_signal_handlers(void)
|
|||
{
|
||||
#ifdef SIGHUP
|
||||
/* ignore SIGHUP signal */
|
||||
if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR)
|
||||
old_sighup_handler = signal(SIGHUP, SIG_IGN);
|
||||
if(old_sighup_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGHUP handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
/* ignore SIGPIPE signal */
|
||||
if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
|
||||
old_sigpipe_handler = signal(SIGPIPE, SIG_IGN);
|
||||
if(old_sigpipe_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGPIPE handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGALRM
|
||||
/* ignore SIGALRM signal */
|
||||
if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR)
|
||||
old_sigalrm_handler = signal(SIGALRM, SIG_IGN);
|
||||
if(old_sigalrm_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGALRM handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGINT
|
||||
/* handle SIGINT signal with our exit_signal_handler */
|
||||
if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigint_handler = signal(SIGINT, exit_signal_handler);
|
||||
if(old_sigint_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGINT handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGINT, 1);
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
/* handle SIGTERM signal with our exit_signal_handler */
|
||||
if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigterm_handler = signal(SIGTERM, exit_signal_handler);
|
||||
if(old_sigterm_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGTERM handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGTERM, 1);
|
||||
#endif
|
||||
#if defined(SIGBREAK) && defined(WIN32)
|
||||
/* handle SIGBREAK signal with our exit_signal_handler */
|
||||
if((old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler);
|
||||
if(old_sigbreak_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGBREAK handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGBREAK, 1);
|
||||
|
|
|
|||
|
|
@ -367,31 +367,36 @@ static void install_signal_handlers(void)
|
|||
{
|
||||
#ifdef SIGHUP
|
||||
/* ignore SIGHUP signal */
|
||||
if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR)
|
||||
old_sighup_handler = signal(SIGHUP, SIG_IGN);
|
||||
if(old_sighup_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGHUP handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
/* ignore SIGPIPE signal */
|
||||
if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
|
||||
old_sigpipe_handler = signal(SIGPIPE, SIG_IGN);
|
||||
if(old_sigpipe_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGPIPE handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGINT
|
||||
/* handle SIGINT signal with our exit_signal_handler */
|
||||
if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigint_handler = signal(SIGINT, exit_signal_handler);
|
||||
if(old_sigint_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGINT handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGINT, 1);
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
/* handle SIGTERM signal with our exit_signal_handler */
|
||||
if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigterm_handler = signal(SIGTERM, exit_signal_handler);
|
||||
if(old_sigterm_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGTERM handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGTERM, 1);
|
||||
#endif
|
||||
#if defined(SIGBREAK) && defined(WIN32)
|
||||
/* handle SIGBREAK signal with our exit_signal_handler */
|
||||
if((old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler);
|
||||
if(old_sigbreak_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGBREAK handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGBREAK, 1);
|
||||
|
|
|
|||
|
|
@ -80,15 +80,18 @@ static Curl_addrinfo *fake_ai(void)
|
|||
|
||||
ss_size = sizeof(struct sockaddr_in);
|
||||
|
||||
if((ai = calloc(1, sizeof(Curl_addrinfo))) == NULL)
|
||||
ai = calloc(1, sizeof(Curl_addrinfo));
|
||||
if(!ai)
|
||||
return NULL;
|
||||
|
||||
if((ai->ai_canonname = strdup("dummy")) == NULL) {
|
||||
ai->ai_canonname = strdup("dummy");
|
||||
if(!ai->ai_canonname) {
|
||||
free(ai);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if((ai->ai_addr = calloc(1, ss_size)) == NULL) {
|
||||
ai->ai_addr = calloc(1, ss_size);
|
||||
if(!ai->ai_addr) {
|
||||
free(ai->ai_canonname);
|
||||
free(ai);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue