cURL / Mailing Lists / curl-library / Single Mail


how to stop curl_easy_perform()

From: Dragos MOINESCU <>
Date: Thu, 13 Sep 2007 15:21:14 +0300


I have a problem in stoping a curl_easy_perform() from another thread. I
tried to curl_easy_cleanup() that handle but got SIGSEGV (which in my
opinion is normal behavior).
My question is how to handle the following situation:
1. $ nc -l -p 8080
2. $ ./test-curl localhost:8080

The client connects to localhost:8080 and sends the request but the server
doesn't respond with no data. The problem is that I need to kill ./test-curl
application with a SIGINT and it MUST exit nicely (to free every resources).
Is there a possibility to close the socket(s) the handler uses?

I understand that curl_easy cannot be used to simultaneous download
resources from different http sites although it might have more connections
opened. Thus it "knows" the active socket it handles. So, I believe there
might be a function called curl_easy_stop() which can be called from another
thread in order to stop curl_easy_perform(). Although this function may
appear in the future, I need an elegant solution for now.

Does anyone have any ideas?


Head of Web Development Team
+4 0729 880 972
Received on 2007-09-13