Re: Ftp Hanging on completion

Giganews Newsgroups
Subject: Re: Ftp Hanging on completion
Posted by:  mikey (nobo…@nowhere.xrw.bc.ca)
Date: Sun, 2 May 2004

"Ron" <ron@nospam.simdata.com.au> wrote on Thu, 29 Apr 2004 19:07:55 +1000

> Hi,
>
> I was wondering if anyone has encountered the problem where an FTP upload
> using TIdFtp hangs after all the data is transferred - IE its trying to
get
> the FTP response.  I am working with a customer on the otherside of the
> world and he has run some debug code for me that shows that the problem
> happens after the data connection has been closed and while its reading
the
> response.  He says that the problem only occurs on files larger than 11M -
> which I don't think is the problem, but maybe its the time it takes to
> upload the file?  The problem is consistent.
>
> My thought were that:
> - maybe its a firewall issue, with short timeouts on its NAT table entries
> - maybe its the server but I haven't been able to work out type it is
other
> than its used by verizon.net
>
> Any other ideas or similar experiences?
>
> Thanks,
>
> Ron

i have this problem right now.  my file is 38 mb.

smaller (12.7 mb, 8.9 mb, 15.9 mb) files ok

i'm using binary file transfer mode and uploading a exe file.

server is ProFTPD 1.2.9 Server.

Starting FTP transfer
Transfer complete
(error here:  read timeout)
Disconnecting.
Disconnected.

procedure TIdFTP.InternalPut(const ACommand: string; ASource: TStream;
AFromBeginning: Boolean = true);
var
  LIP: string;
  LPort: Integer;
  LResponse: Integer;
begin
...(snip)...
  // 226 = download successful, 225 = Abort successful}
  LResponse := GetResponse([225, 226, 250, 426, 450]);  ***1
  if (LResponse = 426) or (LResponse = 450) then begin
    // some servers respond with 226 on ABOR
    GetResponse([226, 225]);
    DoStatus(ftpAborted, [RSFTPStatusAbortTransfer]);
  end;
end;

procedure TIdTCPConnection.GetInternalResponse;
var
  LLine: string;
  LResponse: TStringList;
  LTerm: string;
begin
  LResponse := TStringList.Create; try
    LLine := ReadLnWait;  ***2
    LResponse.Add(LLine);
    if Length(LLine) > 3 then begin
      if LLine[4] = '-' then begin // Multi line response coming
        LTerm := Copy(LLine, 1, 3) + ' ';
{We keep reading lines until we encounter either a line such as
"250" or "250 Read"}
        repeat
          LLine := ReadLnWait;
          LResponse.Add(LLine);
until (Length(LLine) < 4) or (AnsiSameText(Copy(LLine, 1, 4),
LTerm));
      end;
    end;
    FLastCmdResult.ParseResponse(LResponse);
  finally FreeAndNil(LResponse); end;
end;

i observed it with the only two servers i tried it with:  win 2000 server
and the free bsd server.

somebody help!

thanks
mp

remove "nowhere." from my e-mail address to contact me.

---
Message posted via Elk News Web, the newsgroups web interface!
Get it from Atozed Software -http://www.atozed.com/elknews

Replies

None

In response to

Ftp Hanging on completion posted by Ron on Thu, 29 Apr 2004