cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: reuse existing data connection in FTP upload

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 19 Jan 2005 09:21:22 +0100 (CET)

On Tue, 18 Jan 2005, Ashish Nigam wrote:

(again: don't start a new thread by replying to an old mail)

> * Make transfers treated more carefully. We need a way to tell libcurl we
> have data to write

... This TODO item doesn't seem to be related to what you are doing.

> Now I am not using multi interface. So is it possible to do ?

Is what possible to do?

> I have to upload data from memory (not file) in chunks to remote file.

"in chunks" ? An FTP upload is a stream, there are no chunks on the wire. Or
are you referring to that you provide chunks to the libcurl callback function?

> At present, I have to set APPEND mode to true to send all data across in a
> file.

Using append does not make a transfer more reliable.

I figure you mean you have to use append since your connections break and you
re-issue the transfer multiple times.

I don't see how libcurl can do anything about that. If your connection is
unreliable, it will break. The only way to deal with broken connections is to
resume the previous transfer.

> Problem with this is that it creates a new data connection everytime and
> this can be a big overhead if I use small chunk and actual file size is very
> large.

Not only data connection, FTP uses two connections and if your connection to
the server breaks, both connections go down and you need to get both setup
again to continue the transfer.

> Is there any way to tell Curl to re-use data connection and then user can
> just feed-in data in that connection ?

Nope. FTP doesn't allow data connections to be re-used. A data connection is
by definition a newly setup connection and the only way to signal end-of-data
after a transfer is to close the data connection.

> I am using passive mode for data transfer.

It makes no differencet if you use active or passive mode in this regard.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-01-19