Skip to content

Commit

Permalink
Merge branch 'sp/remote-curl-ssl-strerror'
Browse files Browse the repository at this point in the history
Help those who debug http(s) part of the system.

* sp/remote-curl-ssl-strerror:
  remote-curl: include curl_errorstr on SSL setup failures
  • Loading branch information
Junio C Hamano committed Feb 24, 2016
2 parents 9831e92 + 0054045 commit 97c49af
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions remote-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,20 @@ static int run_slot(struct active_request_slot *slot,
err = run_one_slot(slot, results);

if (err != HTTP_OK && err != HTTP_REAUTH) {
error("RPC failed; result=%d, HTTP code = %ld",
results->curl_result, results->http_code);
struct strbuf msg = STRBUF_INIT;
if (results->http_code && results->http_code != 200)
strbuf_addf(&msg, "HTTP %ld", results->http_code);
if (results->curl_result != CURLE_OK) {
if (msg.len)
strbuf_addch(&msg, ' ');
strbuf_addf(&msg, "curl %d", results->curl_result);
if (curl_errorstr[0]) {
strbuf_addch(&msg, ' ');
strbuf_addstr(&msg, curl_errorstr);
}
}
error("RPC failed; %s", msg.buf);
strbuf_release(&msg);
}

return err;
Expand Down

0 comments on commit 97c49af

Please sign in to comment.