cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libCurl 7.16.3: What happens when removing an "running" easy handle from a multi handle and clean it up afterwards?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 3 Apr 2008 22:21:09 +0200 (CEST)

On Thu, 3 Apr 2008, Stefan Krause wrote:

> I'm using libCurl 7.16.3. What happens when removing an "running" easy
> handle from a multi handle and clean it up afterwards?

It should stop the transfer and the cleanup frees all resources.

> What I want to do is to "abort" a HEAD, GET or POST request at any time.

That's exactly what you do by removing the easy handle.

> 1) What happens with the socket connection? Will it stay open and is reused
> after a HTTP request running on it is aborted?

It will most likely get closed since we can't know what leftover data that
hangs around or similar, making it impossible to re-use. I say "most likely"
since it depends on the exact state of the handle when you remove it.

Also, we've changed some of the internals dealing with the multi interface and
connections since 7.16.3.

> 2) What happens with data send to the server? Does the server throw the
> partly received data away?

That's not libcurl's business and I would say that depends entirely on what
you did and what server you're operating against. You should consult the
server docs/code/company/organization to get an answer to that.

> How it is achieved that the server does not operate on incomplete data? How
> it is signaled to the server, that the data is not complete?

That's not signalled at all. You cut off the connection, and it is most likely
disconnected. The latter is of course a clear signal to the server that the
client won't send anything more! ;-)

> 3) Is that possible with libCurl 7.16.3 without problems or do you recommend
> upgrading to a particular version (which one?) ?

I recommend libcurl 7.18.1!

> The SW I am writing parts of is currently short before production release.
> Changes of high risk I have to carefully thin about.

Right, but those are your concerns not mine. I would be more concerned about
the bugs in 7.16.3 than those possibly present in 7.18.1. But then I am the
primary author of this.

> Therefore I am quite interested in your opinion about possible risks of
> aborting HTTP requests ?

I would say that they're likely done better in the latest release than in
7.16.3, but you won't get any guarantees from me... :-)

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-04-03