summaryrefslogtreecommitdiff
path: root/lib/http_negotiate.c
diff options
context:
space:
mode:
authorElia Tufarolo <elia.tufarolo@hcl.com>2018-11-13 18:30:56 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-11-16 23:38:47 +0100
commit07ebaf837843124ee670e5b8c218b80b92e06e47 (patch)
treec71c4f254217f9143030d654664831af94da5972 /lib/http_negotiate.c
parent6d0e487f9f546560593f2aeed7f9e90c7f8f9684 (diff)
downloadcurl-07ebaf837843124ee670e5b8c218b80b92e06e47.tar.gz
http_negotiate: do not close connection until negotiation is completed
Fix HTTP POST using CURLAUTH_NEGOTIATE. Closes #3275
Diffstat (limited to 'lib/http_negotiate.c')
-rw-r--r--lib/http_negotiate.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
index ddcd65b3b..444265d11 100644
--- a/lib/http_negotiate.c
+++ b/lib/http_negotiate.c
@@ -49,6 +49,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
/* Point to the correct struct with this */
struct negotiatedata *neg_ctx;
+ struct auth *authp;
if(proxy) {
userp = conn->http_proxy.user;
@@ -57,6 +58,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP";
host = conn->http_proxy.host.name;
neg_ctx = &data->state.proxyneg;
+ authp = &conn->data->state.authproxy;
}
else {
userp = conn->user;
@@ -65,6 +67,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
data->set.str[STRING_SERVICE_NAME] : "HTTP";
host = conn->host.name;
neg_ctx = &data->state.negotiate;
+ authp = &conn->data->state.authhost;
}
/* Not set means empty */
@@ -95,6 +98,11 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
if(result)
Curl_auth_spnego_cleanup(neg_ctx);
+ else
+ /* If the status is different than 0 and we encountered no errors
+ it means we have to continue. 0 is the OK value for both GSSAPI
+ (GSS_S_COMPLETE) and SSPI (SEC_E_OK) */
+ authp->done = !neg_ctx->status;
return result;
}