The http_request function recently learned to take arbitrary
callbacks; let's expose this functionality to callers.
Signed-off-by: Jeff King <redacted>
---
http.c | 6 ++++++
http.h | 3 +++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/http.c b/http.c
index 9ffd894..91451e9 100644
--- a/http.c
+++ b/http.c
@@ -886,6 +886,12 @@ int http_get_strbuf(const char *url, struct strbuf *result, int options)
return http_request_reauth(url, fwrite_buffer, result, 0, options);
}
+int http_get_callback(const char *url, curl_write_callback cb,
+ void *data, long offset, int options)
+{
+ return http_request_reauth(url, cb, data, offset, options);
+}
+
/*
* Downloads an url and stores the result in the given file.
*diff --git a/http.h b/http.h
index ee16069..4977bde 100644
--- a/http.h
+++ b/http.h
@@ -132,6 +132,9 @@ extern void append_remote_object_url(struct strbuf *buf, const char *url,
*/
int http_get_strbuf(const char *url, struct strbuf *result, int options);
+int http_get_callback(const char *url, curl_write_callback cb, void *data,
+ long offset, int options);
+
/*
* Prints an error message using error() containing url and curl_errorstr,
* and returns ret.
--
1.7.7.2.7.g9f96f