curl-library
Re: stop curl, stop!
Date: Tue, 1 Apr 2014 18:18:11 -0500
On Mon, Mar 31, 2014 at 11:08:33PM +0200, Daniel Stenberg wrote:
> >Clearly, there's some benefit to detecting the error early, and
> >aborting the curl connection... i.e. if you've uploaded 1GB of a
> >100GB file, it makes very little sense to have to upload the
> >entire 99 remaining gigabytes before curl returns with an error.
> >
> >The question is, how do you do that cleanly? I can't find any way
> >to terminate the connection via the easy interface.
>
> I think this one answers the question:
>
> http://curl.haxx.se/docs/faq.html#How_do_I_stop_an_ongoing_transfe
It seems like it does--sort of. It seems as though the problem with
this approach is, as far as I can tell, none of the callbacks have any
idea whether there's more data to read from the server... i.e. if the
server you're uploading to has a response that's longer than the
buffer the callback was handed to read it, you will not be able to
read the whole response (this is often not interesting, but sometimes
it might be).
Am I mistaken?
As it happens, I'm opening the socket myself (In actuality I'm talking
over a Unix domain socket)... How does curl behave if I simply close
the socket?
Thanks
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-04-02