summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-11-01 15:42:25 -0700
committerJunio C Hamano <gitster@pobox.com>2011-11-01 15:42:25 -0700
commit5b5d92aae910243ba12a737bbe117f0ae6ecf5c6 (patch)
tree209db817bad281a12305348fe4708c6f67f6c298
parenta76a326b2af925ab45d2cfffbb6d925763eb6e5d (diff)
parentbe22d92eac809ad2bfa2b7c83ad7cad5a15f1c43 (diff)
downloadgit-5b5d92aae910243ba12a737bbe117f0ae6ecf5c6.tar.gz
Merge jn/maint-http-error-message
* commit 'be22d92eac809ad2bfa2b7c83ad7cad5a15f1c43': http: avoid empty error messages for some curl errors http: remove extra newline in error message
-rw-r--r--http.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/http.c b/http.c
index a59cac45d7..fb3465f50c 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;
}