cURL / Mailing Lists / curl-library / Single Mail


Re: Bug 1355 (CURL_POLL_REMOVE too early) and reasons why it's important

From: Christian Hägele <>
Date: Thu, 10 Jul 2014 10:36:34 +0200

Am 09.07.2014, 05:41 Uhr, schrieb <>:

> I just ran into bug 1355 (CURL_POLL_REMOVE callback occurs after close call rather than before), and there are a couple of points I'd like to make about it as a counterargument to the ones made before on the bug's closure message.

I ran into the same problem myself and wrote about it on the mailing list
a couple of times.
In my opinion libcurl's behavior is not good how it is right now. I started
to write a patch 2 years ago to fix it, but that would involve quite a lot
of code changes in the internal multi-logic, so I stopped it and lived
with the current behavior.

Another point I want to add is a possible bug which *could* be happening
(not seen it myself, yet):
When libcurl closes the socket the same filedescriptor could be reused
again immediately. Depending on your logic in your program that can have
very strange effects because you will get a new fd which you already wait
for. That can be quite weird.
My workaround was to use the CLOSESOCKETFUNCTION. That way you can work
around most or all problems.

It might not be a real bug in libcurl, but it is very strange behavior. 2
years ago I even wrote a testcase which showd and reproduced the problem,
but never committed a patch or the test-case. If there is interest I can
go and search for the code and send it on the mailing-list.



List admin:
Received on 2014-07-10