doc: improve usage string in MyFirstContribution
[gitweb.git] / http.h
diff --git a/http.h b/http.h
index eebf40688cf6f695d12f9fe78e8e6b99bb44a8c4..f0d271bb7b9eadcec3890ae3e850f9ef8f91186c 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,
@@ -223,8 +232,8 @@ struct http_object_request {
        CURLcode curl_result;
        char errorstr[CURL_ERROR_SIZE];
        long http_code;
-       unsigned char sha1[20];
-       unsigned char real_sha1[20];
+       struct object_id oid;
+       struct object_id real_oid;
        git_SHA_CTX c;
        git_zstream stream;
        int zret;
@@ -233,7 +242,7 @@ struct http_object_request {
 };
 
 extern struct http_object_request *new_http_object_request(
-       const char *base_url, unsigned char *sha1);
+       const char *base_url, const struct object_id *oid);
 extern void process_http_object_request(struct http_object_request *freq);
 extern int finish_http_object_request(struct http_object_request *freq);
 extern void abort_http_object_request(struct http_object_request *freq);