Merge branch 'jk/maint-http-half-auth-push'
Fixes a regression in maint-1.7.11 (v1.7.11.7), maint (v1.7.12.1) and master (v1.8.0-rc0). * jk/maint-http-half-auth-push: http: fix segfault in handle_curl_result
This commit is contained in:
7
http.c
7
http.c
@ -745,10 +745,9 @@ char *get_remote_object_url(const char *url, const char *hex,
|
|||||||
return strbuf_detach(&buf, NULL);
|
return strbuf_detach(&buf, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int handle_curl_result(struct active_request_slot *slot)
|
int handle_curl_result(struct active_request_slot *slot,
|
||||||
|
struct slot_results *results)
|
||||||
{
|
{
|
||||||
struct slot_results *results = slot->results;
|
|
||||||
|
|
||||||
if (results->curl_result == CURLE_OK) {
|
if (results->curl_result == CURLE_OK) {
|
||||||
credential_approve(&http_auth);
|
credential_approve(&http_auth);
|
||||||
return HTTP_OK;
|
return HTTP_OK;
|
||||||
@ -822,7 +821,7 @@ static int http_request(const char *url, void *result, int target, int options)
|
|||||||
|
|
||||||
if (start_active_slot(slot)) {
|
if (start_active_slot(slot)) {
|
||||||
run_active_slot(slot);
|
run_active_slot(slot);
|
||||||
ret = handle_curl_result(slot);
|
ret = handle_curl_result(slot, &results);
|
||||||
} else {
|
} else {
|
||||||
error("Unable to start HTTP request for %s", url);
|
error("Unable to start HTTP request for %s", url);
|
||||||
ret = HTTP_START_FAILED;
|
ret = HTTP_START_FAILED;
|
||||||
|
3
http.h
3
http.h
@ -78,7 +78,8 @@ extern int start_active_slot(struct active_request_slot *slot);
|
|||||||
extern void run_active_slot(struct active_request_slot *slot);
|
extern void run_active_slot(struct active_request_slot *slot);
|
||||||
extern void finish_active_slot(struct active_request_slot *slot);
|
extern void finish_active_slot(struct active_request_slot *slot);
|
||||||
extern void finish_all_active_slots(void);
|
extern void finish_all_active_slots(void);
|
||||||
extern int handle_curl_result(struct active_request_slot *slot);
|
extern int handle_curl_result(struct active_request_slot *slot,
|
||||||
|
struct slot_results *results);
|
||||||
|
|
||||||
#ifdef USE_CURL_MULTI
|
#ifdef USE_CURL_MULTI
|
||||||
extern void fill_active_slots(void);
|
extern void fill_active_slots(void);
|
||||||
|
@ -356,7 +356,7 @@ static int run_slot(struct active_request_slot *slot)
|
|||||||
slot->curl_result = curl_easy_perform(slot->curl);
|
slot->curl_result = curl_easy_perform(slot->curl);
|
||||||
finish_active_slot(slot);
|
finish_active_slot(slot);
|
||||||
|
|
||||||
err = handle_curl_result(slot);
|
err = handle_curl_result(slot, &results);
|
||||||
if (err != HTTP_OK && err != HTTP_REAUTH) {
|
if (err != HTTP_OK && err != HTTP_REAUTH) {
|
||||||
error("RPC failed; result=%d, HTTP code = %ld",
|
error("RPC failed; result=%d, HTTP code = %ld",
|
||||||
results.curl_result, results.http_code);
|
results.curl_result, results.http_code);
|
||||||
|
Reference in New Issue
Block a user