cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: post data in a chunk to http server and also receive data from there to a chunk

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 11 Sep 2003 23:22:37 +0200 (CEST)

On Thu, 11 Sep 2003, Jerry G. Chiuan wrote:

> - do we have to have CURLOPT_READFUNCTION get called for each request
> sending?

You provide a callback that gets used when libcurl is supposed to send data,
yes. If you do multiple requests that all send data and you want the callback
used in each, then yes, it'll be used in all requests.

Do note that it might indeed be called multiple times for each request if you
intend to send much data.

> - As I know, it requires one thread to be launched to execute this callback
> function, doesn't it ?

libcurl launches no threads. You typically run curl_easy_perform() in a
thread. Or in 100 threads. You decide, you're the boss.

> Similarly, CURLOPT_WRITEFUNCTION needs to be executed by one thread for each
> response from server, doesn't it?

"needs" ? Well, if you want to receive the data you need a function that
receivies it. Or direct it directly to a file.

Again, this is called from the same thread you call curl_easy_perform() in,
libcurl doesn't fiddle with threads at all.

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-13