cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Wed, 2 Jul 2008 09:00:01 -0500

On Wed, Jul 2, 2008 at 6:44 AM, <lists_at_waynesplace.com> wrote:

> >I suggest you check the return code from the Perform() call. It will
> likely
> >give you a very specific reason for the failure. Failing that, enable
> >debug logs and look through the protocol trace to track the source of the
> >problem.
> >
>
> With the sleep removed here is some debug output from in loop:
> ==============================================================
> 170 files, on # 9...Return code is: 7
> 170 files, on # 27...Return code is: 7
> 170 files, on # 36...Return code is: 7
> 170 files, on # 45...Return code is: 7
> 170 files, on # 53...Return code is: 7
> 170 files, on # 60...Return code is: 7
> 170 files, on # 69...Return code is: 7
> 170 files, on # 76...Return code is: 7
> 170 files, on # 86...Return code is: 7
> 170 files, on # 94...Return code is: 7
> 170 files, on # 107...Return code is: 7
> 170 files, on # 117...Return code is: 7
> 170 files, on # 126...Return code is: 7
> 170 files, on # 141...Return code is: 7
> 170 files, on # 148...Return code is: 7
> 170 files, on # 158...Return code is: 7
> 170 files, on # 168...Return code is: 7
>
> CURL DEBUG (names/paths blanked):
> =================================
> About to connect() to YYY port 21
> Trying YYY...
> connected
> Connected to YYY (YYY) port 21
> 220 ProFTPD 1.2.10 Server () [YYY]
> USER XXX
> 331 Password required for XXX
> PASS XXX
> 230 User XXX logged in.
> We have successfully logged in
> PWD
> 257 "/" is current directory.
> Entry path is '/'
> EPSV
> 229 Entering Extended Passive Mode (|||55474|)
> Trying YYY...
> connected
> Connecting to YYY (YYY) port 55474
> Connected the data stream with PASV!
> TYPE I
> 200 Type set to I
> SIZE pb002209.png
> 213 142174
> RETR pb002209.png
> 150 Opening BINARY mode data connection for pb002209.png (142174 bytes)
> Getting file with size: 142174
> Remembering we are in dir /YYY
> 226 Transfer complete.
> .
> . (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
> couldn't connect to host
> Remembering we are in dir /YYY/pb002238.png
> Connection #0 to host YYY left intact
> ***->170 files, on # 9...Return code is: 7
> Re-using existing connection! (#0) with host YYY
> Connected to YYY (YYY) port 21
> CWD /
>
> Here is what happens when I try the DELETE_FLAG:
> ================================================
> (connect fine)
> SIZE pb002209.png
> 213 142174
> RETR pb002209.png
> 150 Opening BINARY mode data connection for pb002209.png (142174 bytes)
> Getting file with size: 142174
> Remembering we are in dir /YYY
> 226 Transfer complete.
> Connection #0 to host YYY left intact
> Re-using existing connection! (#0) with host YYY
> Connected to YYY (YYY) port 21
> DELE /YYY/pb002209.png
> 250 DELE command successful
> CWD /
> 250 CWD command successful
> EPSV
> 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 dummy
> 550 dummy: No such file or directory
> RETR dummy
> 550 dummy: No such file or directory
> RETR failed: 550
> Connection #0 to host YYY left intact
> ***->170 files, on # 0...Return code is: 19
> Re-using existing connection! (#0) with host YYY
> Connected to YYY (YYY) port 21
> DELE /YYY/pb002209.htm (***THIS file may or may not exist, not found OK)
> 550 /YYY/pb002209.htm: No such file or directory
> QUOT string not accepted: DELE /YYY/pb002209.htm
> Remembering we are in dir dummy
> Connection #0 to host YYY left intact
> ***->170 files, on # 0...Return code is: 21
> Re-using existing connection! (#0) with host YYY
> Connected to YYY (YYY) port 21
> EPSV
> 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
>
> ===============================================
>
> 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)
>
> - Why after the QUOTE command (DELE) does it fail to download any files?
>

I don't know anything about vb.net, but I'm wondering if your CURLFTP handle
is "remembering" the QUOTE command used to delete the file:

          CURLFTP.SetOpt(CURLoption.CURLOPT_QUOTE, Slist)

Certainly other things would seem to be persistent, such as the
userid/password and the progress & write functions that you set before going
into the loop.

Ralph Mitchell
Received on 2008-07-02