cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLINFO_HTTP(PROXY)AUTH_AVAIL for 7.10.8

From: Joerg Mueller-Tolk <curl_at_mueller-tolk.de>
Date: Wed, 03 Sep 2003 10:42:12 +0200
here the updated patch for curl-7.10.8-test regarding
CURLINFO_PROXYAUTH_AVAIL
CURLINFO_HTTPAUTH_AVAIL

patch to curl.h changed in line number:
patch to getinfo.c did not change
patch to urldata.h did not change
patch to transfer.c moved to http.c


diff -u 7.10.8/curl.h curl.h
--- 7.10.8/curl.h       Tue Sep  2 12:46:46 2003
+++ curl.h      Wed Sep  3 10:10:46 2003
@@ -1001,9 +1001,11 @@
   CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG + 20,
   CURLINFO_PRIVATE          = CURLINFO_STRING + 21,
   CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,
+  CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,
+    CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,
   /* Fill in new entries below here! */

-  CURLINFO_LASTONE          = 23
+  CURLINFO_LASTONE          = 25
 } CURLINFO;

 /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as

diff -u http-org.c http.c
--- http-org.c  Wed Sep  3 10:30:28 2003
+++ http.c      Wed Sep  3 10:34:50 2003
@@ -304,6 +304,10 @@

 #ifdef GSSAPI
   if (checkprefix("GSS-Negotiate", start)) {
+    if (data->state.authstage == 401) /* 407 for proxy */
+      data->info.httpauthavail |= CURLAUTH_GSSNEGOTIATE;
+    else
+      data->info.proxyauthavail |= CURLAUTH_GSSNEGOTIATE;
     if(data->state.authwant == CURLAUTH_GSSNEGOTIATE) {
       /* if exactly this is wanted, go */
       int neg = Curl_input_negotiate(conn, start);
@@ -319,6 +323,10 @@
 #ifdef USE_SSLEAY
     /* NTLM support requires the SSL crypto libs */
     if(checkprefix("NTLM", start)) {
+      if (data->state.authstage == 401) /* 407 for proxy */
+        data->info.httpauthavail |= CURLAUTH_NTLM;
+      else
+        data->info.proxyauthavail |= CURLAUTH_NTLM;
       if(data->state.authwant == CURLAUTH_NTLM) {
         /* NTLM authentication is activated */
         CURLntlm ntlm =
@@ -336,6 +344,10 @@
     else
 #endif
       if(checkprefix("Digest", start)) {
+        if (data->state.authstage == 401) /* 407 for proxy */
+          data->info.httpauthavail |= CURLAUTH_DIGEST;
+        else
+          data->info.proxyauthavail |= CURLAUTH_DIGEST;
         if(data->state.authwant == CURLAUTH_DIGEST) {
           /* Digest authentication is activated */
           CURLdigest dig = CURLDIGEST_BAD;
@@ -362,6 +374,10 @@
           }
       }
       else if(checkprefix("Basic", start)) {
+        if (data->state.authstage == 401) /* 407 for proxy */
+          data->info.httpauthavail |= CURLAUTH_BASIC;
+        else
+          data->info.proxyauthavail |= CURLAUTH_BASIC;
         if((data->state.authwant == CURLAUTH_BASIC) && (httpcode == 401)) {
           /* We asked for Basic authentication but got a 401 back
              anyway, which basicly means our name+password isn't
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf Received on 2003-09-03