curl / Mailing Lists / curl-library / Single Mail


Re: Strange behavior of HTTP upload when resuming without seek function

From: Daniel Stenberg <>
Date: Sat, 12 Nov 2016 00:43:59 +0100 (CET)

On Thu, 10 Nov 2016, Johan Uppman wrote:

> I just recently created a simple function for uploading files to a HTTP
> server using libcurl and noticed a strange behavior when I used the
> situation and behavior below.


> Thus if no seek function is specified libcurl will simply reduce the number
> of bytes to read and read them from the beginning of the file. Should not
> the proper behavior be to fallback to the "readuntil" method if not seek
> function is specified or possible to indicate an error, not silently go
> ahead and upload the wrong bytes?

That does indeed sound like a reasonable thing to do.

Just note that resumed uploads are not a defined thing in HTTP. Ie it won't
work univerally and thus this is a fairly unused code path, which could
explain why nobody else has fixed/reported it before.

Did you try to adjust the code and see if it made your case work?

List admin:
Received on 2016-11-12