diff --git a/http-push.c b/http-push.c index bd66f6ab6..439a555a7 100644 --- a/http-push.c +++ b/http-push.c @@ -1551,7 +1551,7 @@ static int remote_exists(const char *path) ret = 0; break; case HTTP_ERROR: - http_error(url, HTTP_ERROR); + http_error(url); default: ret = -1; } diff --git a/http.c b/http.c index 45cc7c701..5e6f67d00 100644 --- a/http.c +++ b/http.c @@ -857,7 +857,8 @@ static int http_request(const char *url, struct strbuf *type, run_active_slot(slot); ret = handle_curl_result(&results); } else { - error("Unable to start HTTP request for %s", url); + snprintf(curl_errorstr, sizeof(curl_errorstr), + "failed to start HTTP request"); ret = HTTP_START_FAILED; } @@ -940,13 +941,9 @@ static int http_get_file(const char *url, const char *filename, int options) return ret; } -int http_error(const char *url, int ret) +void http_error(const char *url) { - /* http_request has already handled HTTP_START_FAILED. */ - if (ret != HTTP_START_FAILED) - error("%s while accessing %s", curl_errorstr, url); - - return ret; + error("%s while accessing %s", curl_errorstr, url); } int http_fetch_ref(const char *base, struct ref *ref) diff --git a/http.h b/http.h index 0fe54f413..fa65128f9 100644 --- a/http.h +++ b/http.h @@ -136,10 +136,9 @@ extern char *get_remote_object_url(const char *url, const char *hex, int http_get_strbuf(const char *url, struct strbuf *content_type, struct strbuf *result, int options); /* - * Prints an error message using error() containing url and curl_errorstr, - * and returns ret. + * Prints an error message using error() containing url and curl_errorstr. */ -int http_error(const char *url, int ret); +void http_error(const char *url); extern int http_fetch_ref(const char *base, struct ref *ref); diff --git a/remote-curl.c b/remote-curl.c index 6c6714b00..9abe4b711 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -216,7 +216,7 @@ static struct discovery* discover_refs(const char *service, int for_push) die("Authentication failed for '%s'", url); default: show_http_message(&type, &buffer); - http_error(url, http_ret); + http_error(url); die("HTTP request failed"); }