]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Some explicit conversion to 'long' of curl_easy_setopt() third argument
authorYang Tse <yangsita@gmail.com>
Wed, 18 Apr 2012 19:03:20 +0000 (21:03 +0200)
committerYang Tse <yangsita@gmail.com>
Wed, 18 Apr 2012 19:03:20 +0000 (21:03 +0200)
Explicit conversion to 'long' of curl_easy_setopt() third argument for options
CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH given that this is how its bitmasks are
docummented to be used.

src/tool_operate.c
tests/libtest/lib510.c
tests/libtest/lib579.c
tests/libtest/lib590.c

index bbefa82987c372628a02a2a31302d59e2d124e38..8c544194a672dc28081e62e35e6c9328456a48c8 100644 (file)
@@ -841,15 +841,20 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
 
           /* new in libcurl 7.10.6 */
           if(config->proxyanyauth)
-            my_setopt_flags(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
+            my_setopt_flags(curl, CURLOPT_PROXYAUTH,
+                            (long) CURLAUTH_ANY);
           else if(config->proxynegotiate)
-            my_setopt_flags(curl, CURLOPT_PROXYAUTH, CURLAUTH_GSSNEGOTIATE);
+            my_setopt_flags(curl, CURLOPT_PROXYAUTH,
+                            (long) CURLAUTH_GSSNEGOTIATE);
           else if(config->proxyntlm)
-            my_setopt_flags(curl, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
+            my_setopt_flags(curl, CURLOPT_PROXYAUTH,
+                            (long) CURLAUTH_NTLM);
           else if(config->proxydigest)
-            my_setopt_flags(curl, CURLOPT_PROXYAUTH, CURLAUTH_DIGEST);
+            my_setopt_flags(curl, CURLOPT_PROXYAUTH,
+                            (long) CURLAUTH_DIGEST);
           else if(config->proxybasic)
-            my_setopt_flags(curl, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
+            my_setopt_flags(curl, CURLOPT_PROXYAUTH,
+                            (long) CURLAUTH_BASIC);
 
           /* new in libcurl 7.19.4 */
           my_setopt(curl, CURLOPT_NOPROXY, config->noproxy);
@@ -914,7 +919,7 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
 
           /* new in libcurl 7.10.6 (default is Basic) */
           if(config->authtype)
-            my_setopt_flags(curl, CURLOPT_HTTPAUTH, config->authtype);
+            my_setopt_flags(curl, CURLOPT_HTTPAUTH, (long) config->authtype);
 
           /* curl 7.19.1 (the 301 version existed in 7.18.2),
              303 was added in 7.26.0 */
index 779164ad5ab29474e9ee333220cd6441447b2b82..8278631c13602f75788525a893cbf8ef9d2d8c66 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, 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
@@ -109,7 +109,7 @@ int test(char *URL)
   test_setopt(curl, CURLOPT_HTTPHEADER, slist);
 
 #ifdef LIB565
-  test_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
+  test_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST);
   test_setopt(curl, CURLOPT_USERPWD, "foo:bar");
 #endif
 
index 56193a1818f73568a5d938224c7c72b8350ca4fc..c5cf603bbf0ba14d0b2145067d88621415ccd774 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, 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
@@ -137,7 +137,7 @@ int test(char *URL)
   /* enforce chunked transfer by setting the header */
   test_setopt(curl, CURLOPT_HTTPHEADER, slist);
 
-  test_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
+  test_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_DIGEST);
   test_setopt(curl, CURLOPT_USERPWD, "foo:bar");
 
   /* we want to use our own progress function */
index 75c90d53f5ecdc98100601fe1a19feafc9f2df41..68603c65ea1ee80f6f280ab84e79fedeb7f53726 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, 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
@@ -55,7 +55,7 @@ int test(char *URL)
   test_setopt(curl, CURLOPT_URL, URL);
   test_setopt(curl, CURLOPT_HEADER, 1L);
   test_setopt(curl, CURLOPT_PROXYAUTH,
-              CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM);
+              (long) (CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM));
   test_setopt(curl, CURLOPT_PROXY, libtest_arg2); /* set in first.c */
   test_setopt(curl, CURLOPT_PROXYUSERPWD, "me:password");