cURL / Mailing Lists / curl-library / Single Mail


Re: stop curl, stop!

From: Derek Martin <>
Date: Wed, 2 Apr 2014 10:40:10 -0500

On Wed, Apr 02, 2014 at 08:29:09AM +0200, Daniel Stenberg wrote:
> On Tue, 1 Apr 2014, wrote:
> I don't understand. If you indeed want to stop the transfer, then no
> you won't get any more data. If you actually want to get the full
> response then I suggest you don't stop the transfer until you've
> gotten the amount you want.
> What am I missing?

The callbacks have no way to know if they will be called again, as far
as I know. So the choices are:

1. don't stop the transfer
2. stop the transfer as soon as you've detected that an error has
   occured, potentially failing to read the full response from the
   server, since you can't know if you'll be called again.

What I think is needed is:

3. stop the transfer only once all of the response has been read.

The callbacks, with the current architecture, can't know when that has
occured, as far as I can tell. I think there needs to be a function to tell curl to finish
reading from the remote end (i.e. read until EOF or you block) and
close the connection.

List admin:
Received on 2014-04-02