[prev in list] [next in list] [prev in thread] [next in thread] 

List:       curl-commits
Subject:    cvs: curl/src main.c,1.167,1.168
From:       Daniel Stenberg <bagder () users ! sourceforge ! net>
Date:       2003-03-31 4:42:22
[Download RAW message or body]

Update of /cvsroot/curl/curl/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19061/src

Modified Files:
	main.c 
Log Message:
--location-trusted added, which does a normal location plus the new
CURLOPT_UNRESTRICTED_AUTH option set TRUE.

Patch by Guillaume Cottenceau.


Index: main.c
===================================================================
RCS file: /cvsroot/curl/curl/src/main.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -r1.167 -r1.168
--- main.c	29 Mar 2003 11:03:30 -0000	1.167
+++ main.c	31 Mar 2003 04:42:20 -0000	1.168
@@ -125,6 +125,9 @@
 
 #define CONF_NETRC_OPT (1<<29)  /* read user+password from either
                                  * .netrc or URL*/
+#define CONF_UNRESTRICTED_AUTH (1<<30)
+/* Send authentication (user+password) when following
+ * locations, even when hostname changed */
 
 #ifndef HAVE_STRDUP
 /* Ultrix doesn't have strdup(), so make a quick clone: */
@@ -380,6 +383,8 @@
        " -l/--list-only     List only names of an FTP directory (F)\n"
        "    --limit-rate <rate> Limit how fast transfers to allow");
   puts(" -L/--location      Follow Location: hints (H)\n"
+       "    --location-trusted Same, and continue to send authentication when \n"
+       "                    following locations, even when hostname changed\n"
        " -m/--max-time <seconds> Maximum time allowed for the transfer\n"
        " -M/--manual        Display huge help text\n"
        " -n/--netrc         Must read .netrc for user name and password\n"
@@ -1064,6 +1069,7 @@
     {"K", "config",      TRUE},
     {"l", "list-only",   FALSE},
     {"L", "location",    FALSE},
+    {"Lt", "location-trusted", FALSE},
     {"m", "max-time",    TRUE},
     {"M", "manual",      FALSE},
     {"n", "netrc",       FALSE},
@@ -1521,6 +1527,13 @@
       break;
     case 'L':
       config->conf ^= CONF_FOLLOWLOCATION; /* Follow Location: HTTP headers */
+      switch (subletter) {
+      case 't':
+        /* Continue to send authentication (user+password) when following
+         * locations, even when hostname changed */
+        config->conf ^= CONF_UNRESTRICTED_AUTH;
+        break;
+      }
       break;
     case 'm':
       /* specified max time */
@@ -2809,6 +2822,8 @@
 
       curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION,
                        config->conf&CONF_FOLLOWLOCATION);
+      curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH,
+                       config->conf&CONF_UNRESTRICTED_AUTH);
       curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, config->conf&CONF_GETTEXT);
       curl_easy_setopt(curl, CURLOPT_MUTE, config->conf&CONF_MUTE);
       curl_easy_setopt(curl, CURLOPT_USERPWD, config->userpwd);



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic