Commit e664cd58 authored by Dan Fandrich's avatar Dan Fandrich
Browse files

Fixed a surprising number of example programs that were passing int arguments

to curl_easy_setopt instead of long.
parent b8abeab6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -90,10 +90,10 @@ static void init(CURLM *cm, int i)
  CURL *eh = curl_easy_init();

  curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, cb);
  curl_easy_setopt(eh, CURLOPT_HEADER, 0);
  curl_easy_setopt(eh, CURLOPT_HEADER, 0L);
  curl_easy_setopt(eh, CURLOPT_URL, urls[i]);
  curl_easy_setopt(eh, CURLOPT_PRIVATE, urls[i]);
  curl_easy_setopt(eh, CURLOPT_VERBOSE, 0);
  curl_easy_setopt(eh, CURLOPT_VERBOSE, 0L);

  curl_multi_add_handle(cm, eh);
}
+4 −3
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ int main(int argc, char **argv)
    curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd);

    /* enable "uploading" (which means PUT when doing HTTP) */
    curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;
    curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L) ;

    /* specify target URL, and note that this URL should also include a file
       name, not only a directory (as you can do with GTP uploads) */
@@ -118,12 +118,13 @@ int main(int argc, char **argv)

    /* and give the size of the upload, this supports large file sizes
       on systems that have general support for it */
    curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size);
    curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
    			(curl_off_t)file_info.st_size);

    /* tell libcurl we can use "any" auth, which lets the lib pick one, but it
       also costs one extra round-trip and possibly sending of all the PUT
       data twice!!! */
    curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
    curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);

    /* set user name and password for the authentication */
    curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
+5 −5
Original line number Diff line number Diff line
@@ -102,16 +102,16 @@ int main(void)

  rv=curl_global_init(CURL_GLOBAL_ALL);
  ch=curl_easy_init();
  rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0);
  rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0);
  rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1);
  rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1);
  rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0L);
  rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0L);
  rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1L);
  rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1L);
  rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction);
  rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout);
  rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction);
  rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr);
  rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
  rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1);
  rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
  rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.cacert.org/");

  /* first try: retrieve page without cacerts' certificate -> will fail
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ main(void)
    char nline[256];

    curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com/"); /* google.com sets "PREF" cookie */
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
    curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
    res = curl_easy_perform(curl);
    if (res != CURLE_OK) {
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ void *my_thread(void *ptr)
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func);
    curl_easy_setopt(curl, CURLOPT_READFUNCTION, my_read_func);
    curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
    curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
    curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func);
    curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, Bar);

Loading