summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-24 13:25:56 -0800
committerJunio C Hamano <gitster@pobox.com>2016-02-24 13:25:56 -0800
commit97c49af6a7c30ca8bf7183bdac8345ca3f8abe56 (patch)
tree5c3000fa0d02303894f1c456a92ea3c73723c601 /remote-curl.c
parent9831e92bfa833ee9c0ce464bbc2f941ae6c2698d (diff)
parent00540458a82ff2454ae1cc63e38a9ce4a1eea878 (diff)
downloadgit-97c49af6a7c30ca8bf7183bdac8345ca3f8abe56.tar.gz
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
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/remote-curl.c b/remote-curl.c
index b33a1e4235..2e2266b856 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -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;