curl-and-php
Re: Sending multiple files
Date: Tue, 4 Nov 2003 08:17:31 +0100 (CET)
On Tue, 4 Nov 2003, Nick Manoleras wrote:
> I'm new to LibCurl and I hope this isn't a stupid question.
You did post this question on the 'curl and php list', which seems a bit odd
if it has nothing to do with PHP. I would recommend subscribing to and using
curl-library instead, it is where other libcurl-hackers hang out.
> I have written a small application using LibCurl to automatically send files
> (ftp) as they are stored in a particular directory. The code is based on the
> ftpput.c sample.
> At present a separate ftp session is initiate for each file. How do I code
> the use of one session to send multiple file (if possible).
You use the same easy handle for every curl_easy_perform() call. libcurl will
then attempt to re-use connections as often as possible. If you upload
multiple files to the same host and port number, libcurl will re-use the
single connection every time.
Do note however that FTP will always require and setup a second connection for
the data to transfer, and that connection cannot be re-used but will be setup
and taken down once for each file transfer. This is by design and restricted
by how the protocol works, nothing libcurl can do anything about.
-- Daniel - been obfuscating curl source code since 1998. [[ Do not post private mails to this email address. They won't reach me. ]] ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/Received on 2003-11-04