From: Junio C Hamano Date: Wed, 24 Feb 2016 21:25:56 +0000 (-0800) Subject: Merge branch 'sp/remote-curl-ssl-strerror' X-Git-Tag: v2.8.0-rc0~32 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/97c49af6a7c30ca8bf7183bdac8345ca3f8abe56?ds=inline;hp=-c 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 --- 97c49af6a7c30ca8bf7183bdac8345ca3f8abe56 diff --combined remote-curl.c index b33a1e4235,e114f24448..2e2266b856 --- a/remote-curl.c +++ b/remote-curl.c @@@ -119,19 -119,6 +119,19 @@@ static int set_option(const char *name else return -1; return 0; + +#if LIBCURL_VERSION_NUM >= 0x070a08 + } else if (!strcmp(name, "family")) { + if (!strcmp(value, "ipv4")) + git_curl_ipresolve = CURL_IPRESOLVE_V4; + else if (!strcmp(value, "ipv6")) + git_curl_ipresolve = CURL_IPRESOLVE_V6; + else if (!strcmp(value, "all")) + git_curl_ipresolve = CURL_IPRESOLVE_WHATEVER; + else + return -1; + return 0; +#endif /* LIBCURL_VERSION_NUM >= 0x070a08 */ } else { return 1 /* unsupported */; } @@@ -452,8 -439,20 +452,20 @@@ static int run_slot(struct active_reque 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; @@@ -840,7 -839,7 +852,7 @@@ static void parse_fetch(struct strbuf * die("http transport does not support %s", buf->buf); strbuf_reset(buf); - if (strbuf_getline(buf, stdin, '\n') == EOF) + if (strbuf_getline_lf(buf, stdin) == EOF) return; if (!*buf->buf) break; @@@ -953,7 -952,7 +965,7 @@@ static void parse_push(struct strbuf *b die("http transport does not support %s", buf->buf); strbuf_reset(buf); - if (strbuf_getline(buf, stdin, '\n') == EOF) + if (strbuf_getline_lf(buf, stdin) == EOF) goto free_specs; if (!*buf->buf) break; @@@ -1003,7 -1002,7 +1015,7 @@@ int main(int argc, const char **argv do { const char *arg; - if (strbuf_getline(&buf, stdin, '\n') == EOF) { + if (strbuf_getline_lf(&buf, stdin) == EOF) { if (ferror(stdin)) error("remote-curl: error reading command stream from git"); return 1;