diff options
author | Daniel Stenberg <daniel@haxx.se> | 2009-04-28 11:19:10 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2009-04-28 11:19:10 +0000 |
commit | e01b7c1ede6f8b91f458259dbed96acce7bf3779 (patch) | |
tree | 5f9fd06a14d6ed451463c9e9d3efa36325abbeb3 /src | |
parent | dd8d472318d6346f98f366438c7a49f3b2d02503 (diff) |
- 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 'src')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c index 06bfaed83..1efa3fe00 100644 --- a/src/main.c +++ b/src/main.c @@ -3302,9 +3302,10 @@ static int my_seek(void *stream, curl_off_t offset, int whence) } #endif if(-1 == lseek(in->fd, offset, whence)) - /* couldn't rewind, the reason is in errno but errno is just not - portable enough and we don't actually care that much why we failed. */ - return 1; + /* couldn't rewind, the reason is in errno but errno is just not portable + enough and we don't actually care that much why we failed. We'll let + libcurl know that it may try other means if it wants to. */ + return CURL_SEEKFUNC_CANTSEEK; return 0; } |