aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-06-10 12:49:16 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-06-10 12:49:16 +0000
commitd0cc92a01a5b373c6730acd84009294da9c29e44 (patch)
tree676b0194dbf4c3c8221f71eb06b905f89a65a0b8 /lib
parentd7980c1a45dfca05eac5800e0f4c4740244c86f3 (diff)
Set auth type differently, we use one CURLOPT_HTTPAUTH instead as we plan
to add more method in the future.
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c36
-rw-r--r--lib/urldata.h2
2 files changed, 28 insertions, 10 deletions
diff --git a/lib/url.c b/lib/url.c
index 0ac487e91..c328e5ac4 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -844,18 +844,38 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
data->set.encoding = (char*)ALL_CONTENT_ENCODINGS;
break;
- case CURLOPT_HTTPDIGEST:
+ case CURLOPT_HTTPAUTH:
/*
- * Enable HTTP Digest Authentication
+ * Set HTTP Authentication type.
*/
- data->set.httpdigest = va_arg(param, long);
- break;
+ {
+ curl_httpauth auth = va_arg(param, long);
+ switch(auth) {
+ case CURLHTTP_BASIC:
+ /* default */
+ data->set.httpdigest = FALSE;
+ data->set.httpnegotiate = FALSE;
+ break;
+ case CURLHTTP_DIGEST:
+ /* Enable HTTP Digest authentication */
+ data->set.httpdigest = TRUE;
+ data->set.httpnegotiate = FALSE;
+ break;
+ case CURLHTTP_NEGOTIATE:
#ifdef GSSAPI
- case CURLOPT_HTTPNEGOTIATE:
- /* Enable HTTP Negotaiate authentication */
- data->set.httpnegotiate = va_arg(param, long);
- break;
+ /* Enable HTTP Negotaiate authentication */
+ data->set.httpdigest = FALSE;
+ data->set.httpnegotiate = TRUE;
+ break;
+#else
+ /* fall-through */
#endif
+ default:
+ return CURLE_FAILED_INIT; /* unsupported type */
+ }
+ }
+ break;
+
case CURLOPT_USERPWD:
/*
* user:password to use in the operation
diff --git a/lib/urldata.h b/lib/urldata.h
index 4dbd4092a..459c5c468 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -689,9 +689,7 @@ struct UserDefined {
long use_port; /* which port to use (when not using default) */
char *userpwd; /* <user:password>, if used */
bool httpdigest; /* if HTTP Digest is enabled */
-#ifdef GSSAPI
bool httpnegotiate; /* if HTTP Negotiate authentication is enabled */
-#endif
char *set_range; /* range, if used. See README for detailed specification
on this syntax. */
long followlocation; /* as in HTTP Location: */