TIdFTP lies in OnWork event

Giganews Newsgroups
Subject: TIdFTP lies in OnWork event
Posted by:  Mitis (mit…@tej.pl)
Date: Tue, 16 May 2006

Hi

TIdFTP->OnWork lies about WorkCount, sending each WorkCount inc by 16 Kb
while I setup IOHandler to 8Kb.
I send one file, 1 Mb large and if I count AWorkCount in this event I get
files size as large as 2MB.
Further more, If I setup progressbar in OnWorkBegin to AWorkCountMax, the
progress will reach 100% in the middle of transfer.
I fiexed problem in this snapshot by doing this:

procedure Tfdotransfer.ftpWork(ASender: TObject; AWorkMode: TWorkMode;
      AWorkCount: Integer);
begin
  if (uploading) then AwokrCount := aworkcount div 2;        ///////////////
<----HERE
  pb.Position := MulDiv(AWorkCount+sizedone,100,sizetogo);
  ldsize.Caption := size2string(AWorkCount+sizedone,'kb');
  application.ProcessMessages;
  if (fabort)and(not faborted) then begin
    faborted:=true;
    ftp.Abort;
  end;
end;

Everything is fine when I download
I got myself snapshot yesterday.

Mitis
/*** god didn't created Man, Man created god./// To nie bog stworzyl Czlowieka,
to Czlowiek stworzyl boga
~Cowboy Bebop ***/

Replies