From e01b7c1ede6f8b91f458259dbed96acce7bf3779 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 28 Apr 2009 11:19:10 +0000 Subject: - 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! --- src/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3