Set auth type differently, we use one CURLOPT_HTTPAUTH instead as we plan

to add more method in the future.
This commit is contained in:
Daniel Stenberg
2003-06-10 12:49:16 +00:00
parent d7980c1a45
commit d0cc92a01a
5 changed files with 52 additions and 34 deletions

View File

@@ -359,9 +359,7 @@ static void help(void)
" -d/--data <data> HTTP POST data (H)\n"
" --data-ascii <data> HTTP POST ASCII data (H)\n"
" --data-binary <data> HTTP POST binary data (H)\n"
#ifdef GSSAPI
" --negotiate Enable HTTP Negotiate Authentication\n"
#endif
" --negotiate Enable HTTP Negotiate Authentication (req GSS-lib)\n"
" --digest Enable HTTP Digest Authentication");
puts(" --disable-eprt Prevents curl from using EPRT or LPRT (F)\n"
" --disable-epsv Prevents curl from using EPSV (F)\n"
@@ -464,9 +462,7 @@ struct Configurable {
bool cookiesession; /* new session? */
bool encoding; /* Accept-Encoding please */
bool digest; /* Digest Authentication */
#ifdef GSSAPI
bool negotiate; /* Negotiate Authentication */
#endif
bool use_resume;
bool resume_from_current;
bool disable_epsv;
@@ -1059,9 +1055,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
{"5i", "limit-rate", TRUE},
{"5j", "compressed", FALSE}, /* might take an arg someday */
{"5k", "digest", FALSE},
#ifdef GSSAPI
{"5l", "negotiate", FALSE},
#endif
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
{"2", "sslv2", FALSE},
@@ -1290,11 +1284,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
config->digest ^= TRUE;
break;
#ifdef GSSAPI
case 'l': /* --negotiate */
config->negotiate ^= TRUE;
break;
#endif
default: /* the URL! */
{
@@ -2989,12 +2981,11 @@ operate(struct Configurable *config, int argc, char *argv[])
/* disable it */
curl_easy_setopt(curl, CURLOPT_FTP_USE_EPRT, FALSE);
/* new in libcurl 7.10.6 */
curl_easy_setopt(curl, CURLOPT_HTTPDIGEST, config->digest);
#ifdef GSSAPI
curl_easy_setopt(curl, CURLOPT_HTTPNEGOTIATE, config->negotiate);
#endif
/* new in libcurl 7.10.6 (default is Basic) */
if(config->digest)
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLHTTP_DIGEST);
else if(config->negotiate)
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLHTTP_NEGOTIATE);
/* new in curl 7.9.7 */
if(config->trace_dump) {