cURL / Mailing Lists / curl-library / Single Mail


Immediately Stopping Ongoing Transfers

From: Saqib Ali <>
Date: Tue, 8 Mar 2011 14:10:29 -0500

I'm interested in interrupting and immediately stopping all ongoing uploads
being done through the multi-interface.

In this post back in 2002,
Daniel said that there is no way to immediately do this other than to use a
callback function (such as the progress callback function.). Is that still
the case?

The docs on the progresscallback function say ( "This function gets
called by libcurl instead of its internal equivalent with a frequent
interval during operation (roughly once per second or sooner)". Is there any
way to control this interval?

Alternative #1, I could set a read callback function which uploads very
small chunks at a time. And then return 0 when I wanted to stop

Alternative #2, I could spawn a new thread, do a multi_curl_perfom (or
easy_curl_perform) in that thread. When I want to stop that transfer, I
could send a Signal to the thread that would cause it to kill itself.

What is the most commonly used approach to this problem?

- Saqib

List admin:
Received on 2011-03-08