cURL / Mailing Lists / curl-library / Single Mail


Re: Read and write on the same cURL handle

From: Dan Fandrich <>
Date: Fri, 27 Jun 2014 09:35:20 +0200

On Thu, Jun 26, 2014 at 02:50:57PM +0100, Richard W.M. Jones wrote:
> Maybe the confusion is that I'm using the "easy" API, and in each call
> I'm using curl_easy_perform in a loop until the read or write is
> finished. See:

The loop around curl_easy_perform shows a fundamental misunderstanding of how
the API works. curl_easy_perform() should be called only once, and once the
transfer that has been set up on the handle has been completed, the function
returns. Calling it in a loop is equivalent to clicking on the same link in a
browser over and over again. Once the transfer is complete, you can use
curl_easy_getinfo to query information about the transfer that just occurred.

>>> Dan
List admin:
Received on 2014-06-27