summaryrefslogtreecommitdiff
path: root/http.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-04-16 19:28:11 +0900
committerJunio C Hamano <gitster@pobox.com>2019-04-16 19:28:11 +0900
commit3151a5fc454ddab36baa9ca91b51fb255cc5ee6f (patch)
treeb1ed34ee30db5c3a79499defc32d5c8be501cc78 /http.h
parentec08c4fd951b9ea5136aaecbaec834ffb665da80 (diff)
parent3d10f72ef8eaa229b285d39b4848aac41e5a8b02 (diff)
Merge branch 'jk/http-walker-status-fix'
dumb-http walker has been updated to share more error recovery strategy with the normal codepath. * jk/http-walker-status-fix: http: use normalize_curl_result() instead of manual conversion http: normalize curl results for dumb loose and alternates fetches http: factor out curl result code normalization
Diffstat (limited to 'http.h')
-rw-r--r--http.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/http.h b/http.h
index 4eb4e808e5..f0d271bb7b 100644
--- a/http.h
+++ b/http.h
@@ -136,6 +136,15 @@ static inline int missing__target(int code, int result)
#define missing_target(a) missing__target((a)->http_code, (a)->curl_result)
+/*
+ * Normalize curl results to handle CURL_FAILONERROR (or lack thereof). Failing
+ * http codes have their "result" converted to CURLE_HTTP_RETURNED_ERROR, and
+ * an appropriate string placed in the errorstr buffer (pass curl_errorstr if
+ * you don't have a custom buffer).
+ */
+void normalize_curl_result(CURLcode *result, long http_code, char *errorstr,
+ size_t errorlen);
+
/* Helpers for modifying and creating URLs */
extern void append_remote_object_url(struct strbuf *buf, const char *url,
const char *hex,