|Subject:||Re: IdFTP Indy10 Get and Abort,Quit,etc.|
|Posted by:||Remy Lebeau (TeamB) (firstname.lastname@example.org)|
|Date:||Mon, 3 Jan 2005|
"pq" <quistn…@hotmail.com> wrote in message
> I've been getting headaches trying to solve this problem with
> both the latest Indy9, and Indy10, and I can't figure out if this
> is somehow my fault or in the IdFTP code.
Abort() support in TIdFTP has always been buggy because TIdFTP is based on
the wrong architecture in the first place. It needs to be based on the
Telnet protocol, but never has been. This has been discussed at length
amongst Indy's developers.
> I have been trying to get out of the Get() function without succesful
> completion, and this has been gotten rather ugly.
There is no clean way to do what you are asking for.
> At first I tried Abort(), which doesn't make Get() exit itself.
In theory it should, because it disconnects the socket that Get() is
actually using. Keep in mind that the FTP protocol uses multiple socket
connections. File transfers (directory listings and statistics) are always
performed on a separate connection than the one being used for sending
commands. Abort() disconnects that socket.
With that said, Abort() is buggy because it does not follow RFC 977
correctly. The RFC requires FTP to be used on top of Telnet and ABOR
utilizes certain Telnet features that are not implemented in Indy at all.
> client sends ABOR to server, and server even replies with the
> aborted succesfully thing)
That is only the first step.
> Then even a Quit(), or a Disconnect(), wouldn't work either.
Both of those only disconnect the socket that is being used for sending
commands, not the socket being used for transfers.
> Even Freeing the destination-filestream wouldn't work.
Yes, it would, because it would cause an EAccessViolation to occur inside of
> Or what else can I do to debug this thing...
One thing you can try is to use the OnWork event to throw your own exception
when desired. That will not send the ABOR command to the server, but it
will stop Get() from progressing any further with the transfer.
IdFTP Indy10 Get and Abort,Quit,etc. posted by pq on Sun, 2 Jan 2005