cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Trying to download and remove files from server via vb.net-need help

From: Wayne Phares <lists_at_waynesplace.com>
Date: Wed, 2 Jul 2008 14:32:59 -0500

----- Original Message -----
To: <curl-library_at_cool.haxx.se>
Sent: Wednesday, July 02, 2008 12:32 PM
Subject: Re: Trying to download and remove files from server via
vb.net-need help

>> With the sleep removed here is some debug output from in loop:
>> ==============================================================
>> 170 files, on # 9...Return code is: 7
>
> Return code 7 is CURLE_COULDNT_CONNECT which implies that the remote
> server
> is not listening to the desired port.
>
>> . (several good transfers)
>> .
>> Connection #0 to host YYY left intact
>> Re-using existing connection! (#0) with host YYY
>> Connected to YYY (YYY) port 21
>> Request has same path as previous transfer
>> EPSV
>> 229 Entering Extended Passive Mode (|||55483|)
>> Trying YYY...
>> Connection refused
>
> That's confirmed by this log. The remote server says to connect to
> port
> 55483 and when curl does, the server doesn't answer. Assuming there
> isn't
> a broken firewall in the way, this is a problem with the server.
>
>> 229 Entering Extended Passive Mode (|||55514|)
>> Trying YYY...
>> connected
>> Connecting to YYY (YYY) port 55514
>> Connected the data stream with PASV!
>> TYPE I
>> 200 Type set to I
>> SIZE pb002229.png
>> 213 136787
>> RETR pb002229.png
>> 150 Opening BINARY mode data connection for pb002229.png (136787
>> bytes)
>> Getting file with size: 136787
>> transfer closed with 136787 bytes remaining to read
>> Remembering we are in dir /YYY
>> Received only partial file: 0 bytes
>> Closing connection #0
>> ***->170 files, on # 1...Return code is: 18
>
> Return code 18 is CURLE_PARTIAL_FILE, which means that not all the
> data
> was transferred. In this case, the server says there are 136787 bytes
> in the
> file but it refuses to send them for some reason. It sounds like a
> fault
> in the server again.
>
>> Questions:
>> - I thought it would reuse the connection since it has not been
>> closed yet - so why is it trying to connect for every transfer? (It
>> even says reusing existing connection #0 with host YYY)
>
> That's the way the FTP protocol works. The control connection is
> reused, but
> every data transfer requires that a new connection be established.
>
>> - Why after the QUOTE command (DELE) does it fail to download any
>> files?
>
> Probably yet another defect in the server, by the looks of it.
>
>>>> Dan

Thanks very much for your reply - I really apprciate your time and
advice. The speed of CURL is impressive.

When I add a sleep(200) - .2 seconds, it finishes with any errors at all
for downloads - tried on 600+ files, no errors at all. This indicates
that the FW is not an issue and that it is simply the server keeping up.
So with the sleep cURL is happy and has no errors...

What about when I keep the sleep and add the QUOTE command to issue the
DELE's...why does it then start failing on every single file? I must
not be closing someting or reseting something and getting the connection
into a strange state, opening a new connection each time would likely
increase the download time significantly...why does the Quote/Slist
create an inabaility to download any more files?

-Wayne
Received on 2008-07-02