summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-04-28 11:19:10 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-04-28 11:19:10 +0000
commite01b7c1ede6f8b91f458259dbed96acce7bf3779 (patch)
tree5f9fd06a14d6ed451463c9e9d3efa36325abbeb3 /include
parentdd8d472318d6346f98f366438c7a49f3b2d02503 (diff)
downloadcurl-e01b7c1ede6f8b91f458259dbed96acce7bf3779.tar.gz
- Bug report #2709004 (http://curl.haxx.se/bug/view.cgi?id=2709004) by Tim
Chen pointed out how curl couldn't upload with resume when reading from a pipe. This ended up with the introduction of a new return code for the CURLOPT_SEEKFUNCTION callback that basically says that the seek failed but that libcurl may try to resolve the situation anyway. In our case this means libcurl will attempt to instead read that much data from the stream instead of seeking and that way curl can now upload with resume when data is read from a stream!
Diffstat (limited to 'include')
-rw-r--r--include/curl/curl.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h
index 7ecb6317b..9c8cd40e0 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -186,15 +186,21 @@ typedef size_t (*curl_write_callback)(char *buffer,
size_t nitems,
void *outstream);
+/* this is the return codes for the seek callbacks */
+#define CURL_SEEKFUNC_OK 0
+#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */
+#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
+ libcurl might try other means instead */
+typedef int (*curl_seek_callback)(void *instream,
+ curl_off_t offset,
+ int origin); /* 'whence' */
+
/* This is a return code for the read callback that, when returned, will
signal libcurl to immediately abort the current transfer. */
#define CURL_READFUNC_ABORT 0x10000000
/* This is a return code for the read callback that, when returned, will
signal libcurl to pause sending data on the current transfer. */
#define CURL_READFUNC_PAUSE 0x10000001
-typedef int (*curl_seek_callback)(void *instream,
- curl_off_t offset,
- int origin); /* 'whence' */
typedef size_t (*curl_read_callback)(char *buffer,
size_t size,