cURL / Mailing Lists / curl-library / Single Mail

curl-library

Delaying data upload

From: Vitaly Lokhmatov <lokhmatov_at_gmail.com>
Date: Wed, 22 Nov 2006 16:58:54 +0200

Hi,

I would like to use multi interface for uploading data via FTP and HTTP. I
cannot provide the entire data to libcurl at the beginning of transfer. The
data which needs to be transferred comes gradually. I also don't want to
collect and postpone the transfer until the entire set of data is available.
The way I need to handle it is the following:

1. Start the request and wait until server invitation for data transfer
comes (for example, HTTP/1.1 100 Continue).
2. Wait until some data for transfer is available or the end of the data
received.
3. Send available data and repeat from step 2 or finish the transfer if the
end of data is received.

I can't wait until data is available in read callback because all other
transfers that I do in the same thread will be stopped also. What I need is
to tell libcurl that I don't have any data for sending now and ask it to
call the callback later. At the same time I would like to be able to
continue other transfers in the same thread.

Is there any way to handle such case?

Thanks,
        Vitaly Lokhmatov
Received on 2006-11-22