TIdTrivialFTPsERVER Poblem!!!

Giganews Newsgroups
Subject: TIdTrivialFTPsERVER Poblem!!!
Posted by:  Andrew (aacg…@gmail.com)
Date: Tue, 28 Nov 2006

Hi:

I'm not sure if this the appropiate list but here i am. I'm using Indy 10.0.52:
I'm developing an application and using trivial ftp server(TIdTrivialFTPServer) and trivial ftp client(TIdTrivialFTP), and none of both operations (Put, Get) do not works properly. I beleve that is due to a code mistake on TIdTrivialFTPServer class, specifically on procedure TIdTrivialFTPServer.DoUDPRead(AData: TIdBytes; ABinding: TIdSocketHandle); implementation.

procedure TIdTrivialFTPServer.DoUDPRead(AData: TIdBytes; ABinding: TIdSocketHandle);
var
  wOp: Word;
  s,
  LBuf,
  FileName: String;
  RequestedBlkSize: integer;
  Mode: TIdTFTPMode;
  PeerInfo: TPeerInfo;
begin
  inherited DoUDPRead(AData, ABinding);
  try
    s := BytesToString(AData);
    wOp := StrToWord(Copy(LBuf,1,2));    //  HERE IS THE MISTAKE. LBuf is Empty. MUST BE Copy(s,1,2)
                                          //  or Copy(AData,1,2)
    wOp := GStack.NetworkToHost(wOp);
    //delete wOp from the request.
    IdDelete(s,1,2);
    if wOp IN [TFTP_RRQ, TFTP_WRQ] then
    begin
      FileName := Fetch(s, #0);
      Mode := StrToMode(Fetch(s, #0));

Replies