cURL / Mailing Lists / curl-library / Single Mail

curl-library

multi interface is broken with active FTP connection

From: Gokhan Sengun <gokhansengun_at_gmail.com>
Date: Fri, 21 Oct 2011 22:45:29 +0300

Hi there,

I think I hit a problem with setting up an active FTP connection with multi
interface.

Short of the story, after sending the PORT (or EPRT) command to the server,
curl does not set the correct file descriptors in the file descriptor sets
(readfs, writefs) given to the "select" call, therefore "select" call times
out. "TYPE I" command could only be sent after the "select" timed-out and
curl_multi_perfom is called afterwards! So each download/upload is delayed
with the amount of time given to select as the timeout.

This could be one source of "performance" issues lately posted if these
people are using multi interface.

In order to demonstrate the problem, I have changed multi-app.c example a
bit and added some more messages. The Code and console output of a sample
run are located in following links. I have set the default timeout as 5
seconds to emphasize the problem. It could be decreased to 10 msec or so to
alleviate the problem but doing so would break the "select" logic and it
would turn into "polling".

http://pastebin.com/874ykhmR
http://pastebin.com/8F4bmqcA

Please give it a look.

-- 
it is twice as difficult to debug a program as to write it. Therefore, if
you put all of your creativity and effort into writing the program, you are
not smart enough to debug it.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-10-21