aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-07 22:33:05 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-07 22:33:05 -0700
commitfe42fe4bcaaf262082a982e43bca1d8cac5a706d (patch)
tree0400d85c7a4553f0957f7a84acd3466da2fa112c /http.c
parenta9906723b23b058cffadaf5db9d87b67384c60c3 (diff)
parent3944ba0cb0ef5119dc9d1708c572855fca88fc43 (diff)
downloadgit-fe42fe4bcaaf262082a982e43bca1d8cac5a706d.tar.gz
git-fe42fe4bcaaf262082a982e43bca1d8cac5a706d.tar.xz
Merge branch 'ms/http-auth'
* ms/http-auth: Allow curl to rewind the read buffers
Diffstat (limited to 'http.c')
-rw-r--r--http.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/http.c b/http.c
index 2fc55d671..2e3d6493e 100644
--- a/http.c
+++ b/http.c
@@ -44,6 +44,25 @@ size_t fread_buffer(void *ptr, size_t eltsize, size_t nmemb, void *buffer_)
return size;
}
+#ifndef NO_CURL_IOCTL
+curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp)
+{
+ struct buffer *buffer = clientp;
+
+ switch (cmd) {
+ case CURLIOCMD_NOP:
+ return CURLIOE_OK;
+
+ case CURLIOCMD_RESTARTREAD:
+ buffer->posn = 0;
+ return CURLIOE_OK;
+
+ default:
+ return CURLIOE_UNKNOWNCMD;
+ }
+}
+#endif
+
size_t fwrite_buffer(const void *ptr, size_t eltsize, size_t nmemb, void *buffer_)
{
size_t size = eltsize * nmemb;