Made sure to pass longs in to curl_easy_setopt where necessary in the

libtest code.
This commit is contained in:
Dan Fandrich 2008-05-22 21:49:52 +00:00
parent e664cd5826
commit d31da176eb
36 changed files with 92 additions and 88 deletions

View File

@ -7,6 +7,10 @@
Changelog Changelog
Daniel Fandrich (22 May 2008)
- Made sure to pass longs in to curl_easy_setopt where necessary in the
example programs and libtest code.
Daniel Stenberg (19 May 2008) Daniel Stenberg (19 May 2008)
- When trying to repeat a multi interface problem I fell over a few multi - When trying to repeat a multi interface problem I fell over a few multi
interface problems: interface problems:

View File

@ -27,7 +27,7 @@ int test(char *URL)
} }
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -28,7 +28,7 @@ int test(char *URL)
return TEST_ERR_MAJOR_BAD; return TEST_ERR_MAJOR_BAD;
} }
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -52,8 +52,8 @@ int test(char *URL)
curl_easy_setopt(c, CURLOPT_URL, URL); curl_easy_setopt(c, CURLOPT_URL, URL);
curl_easy_setopt(c, CURLOPT_USERPWD, "test:ing"); curl_easy_setopt(c, CURLOPT_USERPWD, "test:ing");
curl_easy_setopt(c, CURLOPT_PROXYUSERPWD, "test:ing"); curl_easy_setopt(c, CURLOPT_PROXYUSERPWD, "test:ing");
curl_easy_setopt(c, CURLOPT_HTTPPROXYTUNNEL, 1); curl_easy_setopt(c, CURLOPT_HTTPPROXYTUNNEL, 1L);
curl_easy_setopt(c, CURLOPT_HEADER, 1); curl_easy_setopt(c, CURLOPT_HEADER, 1L);
if ((m = curl_multi_init()) == NULL) { if ((m = curl_multi_init()) == NULL) {
fprintf(stderr, "curl_multi_init() failed\n"); fprintf(stderr, "curl_multi_init() failed\n");

View File

@ -55,7 +55,7 @@ int test(char *URL)
proxy port */ proxy port */
curl_easy_setopt(c, CURLOPT_PROXY, libtest_arg2); curl_easy_setopt(c, CURLOPT_PROXY, libtest_arg2);
curl_easy_setopt(c, CURLOPT_URL, URL); curl_easy_setopt(c, CURLOPT_URL, URL);
curl_easy_setopt(c, CURLOPT_VERBOSE, 1); curl_easy_setopt(c, CURLOPT_VERBOSE, 1L);
if ((m = curl_multi_init()) == NULL) { if ((m = curl_multi_init()) == NULL) {
fprintf(stderr, "curl_multi_init() failed\n"); fprintf(stderr, "curl_multi_init() failed\n");

View File

@ -116,10 +116,10 @@ int test(char *URL)
headerlist = hl; headerlist = hl;
/* enable uploading */ /* enable uploading */
curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ; curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* enable verbose */ /* enable verbose */
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE) ; curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* specify target */ /* specify target */
curl_easy_setopt(curl,CURLOPT_URL, URL); curl_easy_setopt(curl,CURLOPT_URL, URL);

View File

@ -106,7 +106,7 @@ static void *fire(void *ptr)
} }
headers = sethost(NULL); headers = sethost(NULL);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_URL, tdata->url); curl_easy_setopt(curl, CURLOPT_URL, tdata->url);
printf( "CURLOPT_SHARE\n" ); printf( "CURLOPT_SHARE\n" );

View File

@ -59,7 +59,7 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
/* Now specify we want to POST data */ /* Now specify we want to POST data */
curl_easy_setopt(curl, CURLOPT_POST, TRUE); curl_easy_setopt(curl, CURLOPT_POST, 1L);
/* Set the expected POST size */ /* Set the expected POST size */
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
@ -71,10 +71,10 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_INFILE, &pooh); curl_easy_setopt(curl, CURLOPT_INFILE, &pooh);
/* get verbose debug output please */ /* get verbose debug output please */
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* include headers in the output */ /* include headers in the output */
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
/* Perform the request, res will get the return code */ /* Perform the request, res will get the return code */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -74,7 +74,7 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
/* Now specify we want to POST data */ /* Now specify we want to POST data */
curl_easy_setopt(curl, CURLOPT_POST, TRUE); curl_easy_setopt(curl, CURLOPT_POST, 1L);
/* we want to use our own read function */ /* we want to use our own read function */
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
@ -83,10 +83,10 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_INFILE, &pooh); curl_easy_setopt(curl, CURLOPT_INFILE, &pooh);
/* get verbose debug output please */ /* get verbose debug output please */
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* include headers in the output */ /* include headers in the output */
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
/* enforce chunked transfer by setting the header */ /* enforce chunked transfer by setting the header */
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);

View File

@ -27,9 +27,9 @@ int test(char *URL)
} }
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_FILETIME, 1); curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
curl_easy_setopt(curl, CURLOPT_NOBODY, 1); curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -26,8 +26,8 @@ int test(char *URL)
curl = curl_easy_init(); curl = curl_easy_init();
if(curl) { if(curl) {
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_HEADER, 1); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
curl2 = curl_easy_duphandle(curl); curl2 = curl_easy_duphandle(curl);
if(curl2) { if(curl2) {

View File

@ -39,10 +39,10 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
/* Now specify we want to POST data */ /* Now specify we want to POST data */
curl_easy_setopt(curl, CURLOPT_POST, TRUE); curl_easy_setopt(curl, CURLOPT_POST, 1L);
/* Set the expected POST size */ /* Set the expected POST size */
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 1); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 1L);
/* we want to use our own read function */ /* we want to use our own read function */
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
@ -51,10 +51,10 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_INFILE, NULL); curl_easy_setopt(curl, CURLOPT_INFILE, NULL);
/* get verbose debug output please */ /* get verbose debug output please */
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* include headers in the output */ /* include headers in the output */
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
/* Perform the request, res will get the return code */ /* Perform the request, res will get the return code */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -39,16 +39,16 @@ int test(char *URL)
*/ */
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "moo"); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "moo");
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 3); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 3L);
curl_easy_setopt(curl, CURLOPT_POST, 1); curl_easy_setopt(curl, CURLOPT_POST, 1L);
/* this is where transfer 1 would take place, but skip that and change /* this is where transfer 1 would take place, but skip that and change
options right away instead */ options right away instead */
curl_easy_setopt(curl, CURLOPT_NOBODY, 1); curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); /* show verbose for debug */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
curl_easy_setopt(curl, CURLOPT_HEADER, 1); /* include header */ curl_easy_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
/* Now, we should be making a fine HEAD request */ /* Now, we should be making a fine HEAD request */

View File

@ -29,9 +29,9 @@ int test(char *URL)
/* First set the URL that is about to receive our POST. */ /* First set the URL that is about to receive our POST. */
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, NULL); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, NULL);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); /* show verbose for debug */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
curl_easy_setopt(curl, CURLOPT_HEADER, 1); /* include header */ curl_easy_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
/* Now, we should be making a zero byte POST request */ /* Now, we should be making a zero byte POST request */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -29,8 +29,8 @@ int test(char *URL)
/* First set the URL that is about to receive our POST. */ /* First set the URL that is about to receive our POST. */
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_HTTPPOST, NULL); curl_easy_setopt(curl, CURLOPT_HTTPPOST, NULL);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); /* show verbose for debug */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
curl_easy_setopt(curl, CURLOPT_HEADER, 1); /* include header */ curl_easy_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
/* Now, we should be making a zero byte POST request */ /* Now, we should be making a zero byte POST request */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -483,7 +483,7 @@ int test(char *URL)
} }
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -28,8 +28,8 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_USERPWD, "monster:underbed"); curl_easy_setopt(curl, CURLOPT_USERPWD, "monster:underbed");
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* get first page */ /* get first page */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -27,8 +27,8 @@ int test(char *URL)
} }
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_FILETIME, 1); curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -29,7 +29,7 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_PORT, atoi(libtest_arg2)); curl_easy_setopt(curl, CURLOPT_PORT, atoi(libtest_arg2));
curl_easy_setopt(curl, CURLOPT_USERPWD, "xxx:yyy"); curl_easy_setopt(curl, CURLOPT_USERPWD, "xxx:yyy");
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -28,9 +28,9 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2);
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_PORT, 19999); curl_easy_setopt(curl, CURLOPT_PORT, 19999L);
curl_easy_setopt(curl, CURLOPT_USERPWD, "xxx:yyy"); curl_easy_setopt(curl, CURLOPT_USERPWD, "xxx:yyy");
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -27,8 +27,8 @@ int test(char *URL)
} }
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1); curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -71,13 +71,13 @@ int test(char *URL)
} }
/* enable uploading */ /* enable uploading */
curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ; curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* specify target */ /* specify target */
curl_easy_setopt(curl,CURLOPT_URL, URL); curl_easy_setopt(curl,CURLOPT_URL, URL);
/* go verbose */ /* go verbose */
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* use active FTP */ /* use active FTP */
curl_easy_setopt(curl, CURLOPT_FTPPORT, "-"); curl_easy_setopt(curl, CURLOPT_FTPPORT, "-");

View File

@ -74,7 +74,7 @@ int test(char *URL)
curl_easy_setopt(curl[i], CURLOPT_URL, URL); curl_easy_setopt(curl[i], CURLOPT_URL, URL);
/* go verbose */ /* go verbose */
curl_easy_setopt(curl[i], CURLOPT_VERBOSE, 1); curl_easy_setopt(curl[i], CURLOPT_VERBOSE, 1L);
} }
if ((m = curl_multi_init()) == NULL) { if ((m = curl_multi_init()) == NULL) {
@ -142,7 +142,7 @@ int test(char *URL)
the handle first too */ the handle first too */
curl_easy_reset(curl[0]); curl_easy_reset(curl[0]);
curl_easy_setopt(curl[0], CURLOPT_URL, URL); curl_easy_setopt(curl[0], CURLOPT_URL, URL);
curl_easy_setopt(curl[0], CURLOPT_VERBOSE, 1); curl_easy_setopt(curl[0], CURLOPT_VERBOSE, 1L);
/* re-add it */ /* re-add it */
res = (int)curl_multi_add_handle(m, curl[0]); res = (int)curl_multi_add_handle(m, curl[0]);

View File

@ -71,10 +71,10 @@ int test(char *URL)
curl_easy_setopt(curl[i], CURLOPT_URL, target_url); curl_easy_setopt(curl[i], CURLOPT_URL, target_url);
/* go verbose */ /* go verbose */
curl_easy_setopt(curl[i], CURLOPT_VERBOSE, 1); curl_easy_setopt(curl[i], CURLOPT_VERBOSE, 1L);
/* include headers */ /* include headers */
curl_easy_setopt(curl[i], CURLOPT_HEADER, 1); curl_easy_setopt(curl[i], CURLOPT_HEADER, 1L);
/* add handle to multi */ /* add handle to multi */
if ((res = (int)curl_multi_add_handle(m, curl[i])) != CURLM_OK) { if ((res = (int)curl_multi_add_handle(m, curl[i])) != CURLM_OK) {
@ -91,7 +91,7 @@ int test(char *URL)
} }
} }
curl_multi_setopt(m, CURLMOPT_PIPELINING, 1); curl_multi_setopt(m, CURLMOPT_PIPELINING, 1L);
ml_timedout = FALSE; ml_timedout = FALSE;
ml_start = tutil_tvnow(); ml_start = tutil_tvnow();

View File

@ -90,10 +90,10 @@ int test(char *URL)
return TEST_ERR_MAJOR_BAD; return TEST_ERR_MAJOR_BAD;
} }
curl_multi_setopt(multi, CURLMOPT_PIPELINING, 1); curl_multi_setopt(multi, CURLMOPT_PIPELINING, 1L);
curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, fwrite); curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, fwrite);
curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1); curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1L);
curl_easy_setopt(easy, CURLOPT_URL, URL); curl_easy_setopt(easy, CURLOPT_URL, URL);
if (curl_multi_add_handle(multi, easy) != CURLM_OK) { if (curl_multi_add_handle(multi, easy) != CURLM_OK) {
@ -107,7 +107,7 @@ int test(char *URL)
} }
curl_easy_reset(easy); curl_easy_reset(easy);
curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1); curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1L);
curl_easy_setopt(easy, CURLOPT_URL, libtest_arg2); curl_easy_setopt(easy, CURLOPT_URL, libtest_arg2);
if (curl_multi_add_handle(multi, easy) != CURLM_OK) { if (curl_multi_add_handle(multi, easy) != CURLM_OK) {

View File

@ -486,7 +486,7 @@ int test(char *URL)
} }
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -30,9 +30,9 @@ static void init(CURLM *cm, const char* url, const char* userpwd,
curl_easy_setopt(eh, CURLOPT_URL, url); curl_easy_setopt(eh, CURLOPT_URL, url);
curl_easy_setopt(eh, CURLOPT_PROXY, PROXY); curl_easy_setopt(eh, CURLOPT_PROXY, PROXY);
curl_easy_setopt(eh, CURLOPT_PROXYUSERPWD, userpwd); curl_easy_setopt(eh, CURLOPT_PROXYUSERPWD, userpwd);
curl_easy_setopt(eh, CURLOPT_PROXYAUTH, CURLAUTH_ANY); curl_easy_setopt(eh, CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY);
curl_easy_setopt(eh, CURLOPT_VERBOSE, 1); curl_easy_setopt(eh, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(eh, CURLOPT_HEADER, 1); curl_easy_setopt(eh, CURLOPT_HEADER, 1L);
curl_easy_setopt(eh, CURLOPT_HTTPHEADER, headers); /* custom Host: */ curl_easy_setopt(eh, CURLOPT_HTTPHEADER, headers); /* custom Host: */
curl_multi_add_handle(cm, eh); curl_multi_add_handle(cm, eh);

View File

@ -89,10 +89,10 @@ int test(char *URL)
} }
/* enable uploading */ /* enable uploading */
curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ; curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* enable verbose */ /* enable verbose */
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE) ; curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* specify target */ /* specify target */
curl_easy_setopt(curl,CURLOPT_URL, URL); curl_easy_setopt(curl,CURLOPT_URL, URL);

View File

@ -50,13 +50,13 @@ int test(char *URL)
} }
/* enable verbose */ /* enable verbose */
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE) ; curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* enable NOBODY */ /* enable NOBODY */
curl_easy_setopt(curl, CURLOPT_NOBODY, TRUE) ; curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
/* disable HEADER */ /* disable HEADER */
curl_easy_setopt(curl, CURLOPT_HEADER, FALSE) ; curl_easy_setopt(curl, CURLOPT_HEADER, 0L);
/* specify target */ /* specify target */
curl_easy_setopt(curl,CURLOPT_URL, URL); curl_easy_setopt(curl,CURLOPT_URL, URL);

View File

@ -35,13 +35,13 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
#ifdef LIB545 #ifdef LIB545
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, sizeof teststring - 1); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof teststring - 1);
#endif #endif
curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, teststring); curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, teststring);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); /* show verbose for debug */ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */
curl_easy_setopt(curl, CURLOPT_HEADER, 1); /* include header */ curl_easy_setopt(curl, CURLOPT_HEADER, 1L); /* include header */
/* Update the original data to detect non-copy. */ /* Update the original data to detect non-copy. */
strcpy(teststring, "FAIL"); strcpy(teststring, "FAIL");

View File

@ -76,8 +76,8 @@ int test(char *URL)
} }
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
#ifdef LIB548 #ifdef LIB548
/* set the data to POST with a mere pointer to a zero-terminated string */ /* set the data to POST with a mere pointer to a zero-terminated string */
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, UPLOADTHIS); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, UPLOADTHIS);
@ -88,13 +88,13 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_READFUNCTION, readcallback); curl_easy_setopt(curl, CURLOPT_READFUNCTION, readcallback);
curl_easy_setopt(curl, CURLOPT_READDATA, &counter); curl_easy_setopt(curl, CURLOPT_READDATA, &counter);
/* We CANNOT do the POST fine without setting the size (or choose chunked)! */ /* We CANNOT do the POST fine without setting the size (or choose chunked)! */
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(UPLOADTHIS)); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(UPLOADTHIS));
#endif #endif
curl_easy_setopt(curl, CURLOPT_POST, 1); curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2);
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3); curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3);
curl_easy_setopt(curl, CURLOPT_PROXYAUTH, curl_easy_setopt(curl, CURLOPT_PROXYAUTH,
CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC ); (long) (CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC) );
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -32,11 +32,11 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2);
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1); curl_easy_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L);
curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
if(libtest_arg3) if(libtest_arg3)
/* enable ascii/text mode */ /* enable ascii/text mode */
curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, TRUE); curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -158,17 +158,17 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace); curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace);
curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config); curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config);
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */ /* the DEBUGFUNCTION has no effect until we enable VERBOSE */
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* setup repeated data string */ /* setup repeated data string */
for (i=0; i < sizeof data; ++i) for (i=0; i < sizeof data; ++i)
data[i] = fill[i % sizeof fill]; data[i] = fill[i % sizeof fill];
/* Post */ /* Post */
curl_easy_setopt(curl, CURLOPT_POST, 1); curl_easy_setopt(curl, CURLOPT_POST, 1L);
/* Setup read callback */ /* Setup read callback */
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, sizeof data); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof data);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
/* Write callback */ /* Write callback */
@ -182,7 +182,7 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
/* Accept any auth. But for this bug configure proxy with DIGEST, basic might work too, not NTLM */ /* Accept any auth. But for this bug configure proxy with DIGEST, basic might work too, not NTLM */
curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY); curl_easy_setopt(curl, CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
fprintf(stderr, "curl_easy_perform = %d\n", (int)res); fprintf(stderr, "curl_easy_perform = %d\n", (int)res);

View File

@ -60,10 +60,10 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
curl_easy_setopt(curl, CURLOPT_POST, 1); curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, POSTLEN); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)POSTLEN);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_HEADER, 1); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
curl_easy_setopt(curl, CURLOPT_READFUNCTION, myreadfunc); curl_easy_setopt(curl, CURLOPT_READFUNCTION, myreadfunc);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
curl_easy_cleanup(curl); curl_easy_cleanup(curl);

View File

@ -96,7 +96,7 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
/* Now specify we want to POST data */ /* Now specify we want to POST data */
curl_easy_setopt(curl, CURLOPT_POST, TRUE); curl_easy_setopt(curl, CURLOPT_POST, 1L);
/* Set the expected POST size */ /* Set the expected POST size */
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
@ -111,10 +111,10 @@ int test(char *URL)
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
/* get verbose debug output please */ /* get verbose debug output please */
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* include headers in the output */ /* include headers in the output */
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
/* Perform the request, res will get the return code */ /* Perform the request, res will get the return code */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@ -80,8 +80,8 @@ int test(char *URL)
} }
curl_easy_setopt(curl, CURLOPT_URL, URL); curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE); curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
/* read the POST data from a callback */ /* read the POST data from a callback */
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctlcallback); curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctlcallback);
@ -91,11 +91,11 @@ int test(char *URL)
/* We CANNOT do the POST fine without setting the size (or choose chunked)! */ /* We CANNOT do the POST fine without setting the size (or choose chunked)! */
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(UPLOADTHIS)); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(UPLOADTHIS));
curl_easy_setopt(curl, CURLOPT_POST, 1); curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2); curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2);
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3); curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, libtest_arg3);
curl_easy_setopt(curl, CURLOPT_PROXYAUTH, curl_easy_setopt(curl, CURLOPT_PROXYAUTH,
CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC ); (long) (CURLAUTH_NTLM | CURLAUTH_DIGEST | CURLAUTH_BASIC) );
if ((m = curl_multi_init()) == NULL) { if ((m = curl_multi_init()) == NULL) {
fprintf(stderr, "curl_multi_init() failed\n"); fprintf(stderr, "curl_multi_init() failed\n");