Re: ABOR ERROR!!

Giganews Newsgroups
Subject: Re: ABOR ERROR!!
Posted by:  ron (rrroo…@yahoo.com.au)
Date: Wed, 22 Oct 2003

Fernando Tirelli wrote:

> Please can anybody tell me this!!....
>
> Thanks... it's very important.
>
> Hello i have problems with the abort the download and the upload. When i
> abort the download, the function Get never return, and when i abort in the
> Upload the server rise and exeption and then become unstable.
>
> I make this change in the IdFTP component and the upload become stable:
>
> procedure TIdFTP.Abort;
> begin
>  // only send the abort command. The Data channel is supposed to disconnect
>  if Connected then begin
>    WriteLn('ABOR');                  {Do not translate}
>  end;
>  // Kill the data channel: usually, the server doesn't close it by itself
>  KillDataChannel;
>  // Fernando 24-07-2003: I wait 100 milliseconds and the server do not rise
> and exeption.
>  Sleep(100);
> end;
>
> But the Download still affected, so i prove some changes and when i make an
> Abort() and in the next line i make a Quit() the Download works very well.
> I am  using the Indy 9 i want to know if this problem was solved or if
> exists another solution, or if my solution is a valid one.
>
> Regards.
>
I have the same problem and I have 'sort-of' fixed it enough to get by for my
purpose.  The fix is obviously a cludge and please don't dump on me unless you
have a better fix......

I changed the Abort procedure in IfFTP.pas to:

procedure TIdFTP.Abort;
var
  i: Integer;
begin
  // only send the abort command. The Data channel is supposed to disconnect
  if Connected then begin
      WriteLn('ABOR');                  {Do not translate}
  end;
  // Kill the data channel: usually, the server doesn't close it by itself
  KillDataChannel;
  // RWB::>>
  for i := 1 to 5 do begin
    ReadLn(LF,500);
  end;
  // <<::RWB
end;

All it really does is try to gobble up the server responses that remain behind
waiting for the next unsuspecting SendCmd().  Obviously, my method takes a
couple of seconds to clean up while it waits for the responses.  If responses
take longer than the alloted time then I guess the problem will still exists.
Ideally, Indy would clear the reponse stack before each command to ensure that
it is interpreting responses for the command it just issued, rather than
something left over from the ABOR command.

If anyone's got a real fix then I'd be pleased to here about it.

Cheers,

Ron

Replies

In response to

ABOR ERROR!! posted by Fernando Tirelli on Sat, 26 Jul 2003