aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 6571e1636..2eda08889 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -96,6 +96,9 @@
#include "getinfo.h"
#include "ssluse.h"
#include "http_digest.h"
+#ifdef GSSAPI
+#include "http_negotiate.h"
+#endif
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -719,6 +722,20 @@ CURLcode Curl_readwrite(struct connectdata *conn,
if(data->set.get_filetime)
data->info.filetime = k->timeofdoc;
}
+#ifdef GSSAPI
+ else if (Curl_compareheader(k->p, "WWW-Authenticate:",
+ "GSS-Negotiate") &&
+ (401 == k->httpcode) &&
+ data->set.httpnegotiate) {
+ int neg;
+
+ neg = Curl_input_negotiate(conn,
+ k->p+strlen("WWW-Authenticate:"));
+ if (neg == 0)
+ /* simulate redirection to make curl send the request again */
+ conn->newurl = strdup(data->change.url);
+ }
+#endif
else if(checkprefix("WWW-Authenticate:", k->p) &&
(401 == k->httpcode) &&
data->set.httpdigest /* Digest authentication is