Hello,

procedure TFtpServer.FreeCurrentPasvPort(AClient : TFtpCtrlSocket);
var
    CurrentPort : Integer;
    ErrorCode   : Integer;
begin
    { FLD changed following lines, 
        }
    { FreeCurrentPasvPort might be called when the socket is already 
closed! }
    if AClient.DataSocket.State = wsClosed then
        Val(AClient.DataSocket.Port, CurrentPort, ErrorCode)
    else
        Val(AClient.DataSocket.GetXPort, CurrentPort, ErrorCode);
    if (CurrentPort <> 0) and // THIS LINE PREVENTS AV WHEN NO STOR 
PERMISSION IS PRESENT AND THIS FUNCTION IS CALLED TWICE.
       (CurrentPort >= FPasvPortRangeStart) and
       (CurrentPort <= (FPasvPortRangeStart + FPasvPortRangeSize)) then 
begin
        PBoolean(PChar(FPasvPortTable) +
                 SizeOf(Boolean) * (CurrentPort - FPasvPortRangeStart))^ := 
FALSE;
    end;
    AClient.PassiveMode := FALSE;  { FLD 29.12.05 }
end;

Best Regards,

Gorkem Ates 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to