mirror of
https://github.com/curl/curl.git
synced 2026-07-24 17:57:18 +03:00
- 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!
This commit is contained in:
parent
dd8d472318
commit
e01b7c1ede
8 changed files with 119 additions and 83 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue