[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ftpapi Digest, Vol 73, Issue 4 - SIZE error on FTP API



Hi Dan,

Wow, apparently I already had a feature (FTP_sizereq) to turn the size off. I forgot all about that. Yes, that will tell FTPAPI not to ask for the size during the GET transfer. Though, I still don't understand how it could possibly time out on a SIZE request, that doesn't make any sense. Also, I see that the "timeout" message is not coming from FTPAPI, but it's coming from the server. That doesn't make sense, either -- the server doesn't have to wait for FTPAPI during a size request, so how can it time out?

However, in your second example, where you've turned off the SIZE request, the timeout does make sense. There it's attempting to make a connection to IP address 192.168.250.3 on port 52540. Stuff like this often causes problems, since the port number is determined semi-randomly, and people don't always allow all ports open through their firewall.

Please try using passive mode to see if that solves the problem. After connecting, do this:

   callp FTP_sizereq(sess: *off)
   callp FTP_passiveMode(sess: *on)

See if that helps.


On 12/15/2012 11:03 PM, Dan Dan wrote:
    To see what would happen I added the option to turn off the SIZE
    command.
    c                   callp     FTP_sizereq(sess: *off)

    This allowed the program to continue and start the GET command.
    It placed a file header on the IFS with the correct location and name,
    however it didn't place any data in the file.

     * open the file to retrieve
    c                   eval      wwFD = OpnFile(wwLocal: 'W': p_writ
    c                                         p_close: peSocket)
    c                   if        wwFD < 0
    c                   return    -1

    Within FTP_getraw I see that it issued the 'RETR' command.
    NOTE: The type of file is '*STMF'


    2276                    if        SendLine(wkSocket: 'RETR ' +
    peRemote)<0
    2277                    callp
    close(wwSock)
    2278                    return
    -1
    2279
    endif

    RETR /00000010000007009747180009010910909.pdf

    Next it tried to receive a response.

    2281 Opening transfer now...
    2282 eval wwReply = Reply(peSocket: wwMsg)
    2283 if wwReply < 0
    2284 callp close(wwSock)

    After setting on the wwReply for 2 minutes I received:
    WWREPLY = 421
    Timeout (120 seconds): closing control connection.

    Job log below
    0: FTPAPI version 2.2 released on
    2005-09-20
    6: 220-Microsoft FTP
    Service
    6: 220 Hey Get
    OUT!!!!
    6: > USER
    anonymous
    6: 331 Anonymous access allowed, send identity (e-mail name) as
    password.
    6: > PASS **********
    6: 230 Anonymous user logged in.
    6: > SITE NAMEFMT 1
    6: 500 'SITE NAMEFMT 1': command not understood
    6: > TYPE I
    6: 200 Type set to I.
    6: > PORT 192,168,250,3,205,60
    6: 200 PORT command successful.
    6: > RETR /00000010000007009747180009010910909.pdf
    6: 421 Timeout (120 seconds): closing control connection.
    6: > QUIT
    6: 421 Terminating connection.

    Not sure at this stage what would cause this error.

    Thanks again for your help.
    Dan



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------