Skip to content

Commit 97c49af

Browse files
committed
Merge branch 'sp/remote-curl-ssl-strerror'
Help those who debug http(s) part of the system. * sp/remote-curl-ssl-strerror: remote-curl: include curl_errorstr on SSL setup failures
2 parents 9831e92 + 0054045 commit 97c49af

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

remote-curl.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,20 @@ static int run_slot(struct active_request_slot *slot,
452452
err = run_one_slot(slot, results);
453453

454454
if (err != HTTP_OK && err != HTTP_REAUTH) {
455-
error("RPC failed; result=%d, HTTP code = %ld",
456-
results->curl_result, results->http_code);
455+
struct strbuf msg = STRBUF_INIT;
456+
if (results->http_code && results->http_code != 200)
457+
strbuf_addf(&msg, "HTTP %ld", results->http_code);
458+
if (results->curl_result != CURLE_OK) {
459+
if (msg.len)
460+
strbuf_addch(&msg, ' ');
461+
strbuf_addf(&msg, "curl %d", results->curl_result);
462+
if (curl_errorstr[0]) {
463+
strbuf_addch(&msg, ' ');
464+
strbuf_addstr(&msg, curl_errorstr);
465+
}
466+
}
467+
error("RPC failed; %s", msg.buf);
468+
strbuf_release(&msg);
457469
}
458470

459471
return err;

0 commit comments

Comments
 (0)