curl-library
RE: Connection being reused following a cancellation (HTTP)
Date: Fri, 30 Sep 2011 22:57:56 +0200 (CEST)
On Fri, 30 Sep 2011, Gary Maxwell wrote:
>> Thanks a lot for this. I agree with you that it certainly looks like what
>> you describe. I hope to be able look into this very soon.
>
> Is it always the right thing to close the connection if an operation is
> cancelled? As the sample indicates, the connection can still be used for
> requests after the cancellation, which is what I would actually expect. If
> my application supports simultaneous, independent requests to the same
> server, I would not want the cancellation of one request to bugger any
> others.
>
> IMO, it sounds like a "CLOSE_CONNECTION_IF_OPERATION_IS_ABORTED" option is
> being solicited.
It needs to be closed if the state of the connection is unknown, unclear or
uncertain. We can only leave a connection for re-use if we know that we can
re-use it in a controlled manner.
In some situations in the code we take the safe way out and close down if
there's a risk that it could cause problems.
When a transfer is abrubtly being aborted like Vladimir showed us, libcurl
cannot possibly re-use that connection again and it must be closed.
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2011-09-30