diff options
author | Jeff King <peff@peff.net> | 2012-04-10 11:53:40 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-10 09:12:13 -0700 |
commit | dfa1725a3ec57098637b698ffc2b2e2459acc518 (patch) | |
tree | cd60c4d5053081b20956bc14158b402ec60028c6 /http.c | |
parent | 5a9681f46aa9e152f32e76d7ade9d4c11313f99a (diff) | |
download | git-dfa1725a3ec57098637b698ffc2b2e2459acc518.tar.gz |
fix http auth with multiple curl handles
HTTP authentication is currently handled by get_refs and fetch_ref, but
not by fetch_object, fetch_pack or fetch_alternates. In the
single-threaded case, this is not an issue, since get_refs is always
called first. It recognigzes the 401 and prompts the user for
credentials, which will then be used subsequently.
If the curl multi interface is used, however, only the multi handle used
by get_refs will have credentials configured. Requests made by other
handles fail with an authentication error.
Fix this by setting CURLOPT_USERPWD whenever a slot is requested.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -494,6 +494,8 @@ struct active_request_slot *get_active_slot(void) curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDS, NULL); curl_easy_setopt(slot->curl, CURLOPT_UPLOAD, 0); curl_easy_setopt(slot->curl, CURLOPT_HTTPGET, 1); + if (http_auth.password) + init_curl_http_auth(slot->curl); return slot; } |