mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:43:34 +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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue