static int curl_ftp_no_epsv;
static const char *curl_http_proxy;
static const char *curl_cookie_file;
-static struct credential http_auth = CREDENTIAL_INIT;
+struct credential http_auth = CREDENTIAL_INIT;
static int http_proactive_auth;
static const char *user_agent;
credential_reject(&http_auth);
return HTTP_NOAUTH;
} else {
- credential_fill(&http_auth);
return HTTP_REAUTH;
}
} else {
die("BUG: HTTP_KEEP_ERROR is only supported with strbufs");
}
}
+
+ credential_fill(&http_auth);
+
return http_request(url, result, target, options);
}
extern int active_requests;
extern int http_is_verbose;
extern size_t http_post_buffer;
+extern struct credential http_auth;
extern char curl_errorstr[CURL_ERROR_SIZE];
#include "pkt-line.h"
#include "sideband.h"
#include "argv-array.h"
+#include "credential.h"
static struct remote *remote;
static const char *url; /* always ends with a trailing slash */
if (large_request) {
do {
err = probe_rpc(rpc);
+ if (err == HTTP_REAUTH)
+ credential_fill(&http_auth);
} while (err == HTTP_REAUTH);
if (err != HTTP_OK)
return -1;
curl_easy_setopt(slot->curl, CURLOPT_FILE, rpc);
err = run_slot(slot);
- if (err == HTTP_REAUTH && !large_request)
+ if (err == HTTP_REAUTH && !large_request) {
+ credential_fill(&http_auth);
goto retry;
+ }
if (err != HTTP_OK)
err = -1;