}
}
+void http_reauth_prepare(int all_capabilities)
+{
+ credential_fill(the_repository, &http_auth, all_capabilities);
+}
+
/* *var must be free-able */
static void var_override(char **var, char *value)
{
sleep(retry_delay);
}
} else if (ret == HTTP_REAUTH) {
- credential_fill(the_repository, &http_auth, 1);
+ http_reauth_prepare(1);
}
ret = http_request(url, result, target, options);
extern ssize_t http_post_buffer;
extern struct credential http_auth;
+/**
+ * Prepare for an HTTP re-authentication retry. This fills credentials
+ * via credential_fill() so the next request can include them.
+ */
+void http_reauth_prepare(int all_capabilities);
+
extern char curl_errorstr[CURL_ERROR_SIZE];
enum http_follow_config {
do {
err = probe_rpc(rpc, &results);
if (err == HTTP_REAUTH)
- credential_fill(the_repository, &http_auth, 0);
+ http_reauth_prepare(0);
} while (err == HTTP_REAUTH);
if (err != HTTP_OK)
return -1;
rpc->any_written = 0;
err = run_slot(slot, NULL);
if (err == HTTP_REAUTH && !large_request) {
- credential_fill(the_repository, &http_auth, 0);
+ http_reauth_prepare(0);
curl_slist_free_all(headers);
goto retry;
}