Merge branch 'en/merge-directory-renames'
[gitweb.git] / http.h
diff --git a/http.h b/http.h
index 4eb4e808e5731a3a9a650ca4c1efb3e471604d05..ddfe52f0232150e9506577ade34dfeaab61fc3ca 100644 (file)
--- 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,
@@ -225,7 +234,7 @@ struct http_object_request {
        long http_code;
        struct object_id oid;
        struct object_id real_oid;
-       git_SHA_CTX c;
+       git_hash_ctx c;
        git_zstream stream;
        int zret;
        int rename;