X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=http.c;h=fb3465f50c95ab9cb3e6fae1d1e594f6ae0b9c42;hb=a6045720bdb5faa6bcf7ecf4fa732632202d52ac;hp=a59cac45d7a6c159e740cab9b20bb63ab91f7c48;hpb=2730f55527143d3476c159cebbdb63d5e6a5c2a8;p=git.git diff --git a/http.c b/http.c index a59cac45d..fb3465f50 100644 --- a/http.c +++ b/http.c @@ -851,8 +851,13 @@ static int http_request(const char *url, void *result, int target, int options) init_curl_http_auth(slot->curl); ret = HTTP_REAUTH; } - } else + } else { + if (!curl_errorstr[0]) + strlcpy(curl_errorstr, + curl_easy_strerror(results.curl_result), + sizeof(curl_errorstr)); ret = HTTP_ERROR; + } } else { error("Unable to start HTTP request for %s", url); ret = HTTP_START_FAILED; @@ -908,7 +913,7 @@ int http_error(const char *url, int ret) { /* http_request has already handled HTTP_START_FAILED. */ if (ret != HTTP_START_FAILED) - error("%s while accessing %s\n", curl_errorstr, url); + error("%s while accessing %s", curl_errorstr, url); return ret; }