Additional options for FTP server configuration (ports, timeout, dupe IPs)

This commit is contained in:
mysticbbs 2012-02-16 22:35:23 -05:00
parent ea9cf4cbde
commit 707c0799b7
2 changed files with 5 additions and 9 deletions

View File

@ -388,7 +388,7 @@ Begin
FTPServer := TServerManager.Create(bbsConfig, bbsConfig.InetFTPPort, bbsConfig.inetFTPMax, NodeData, @CreateFTP);
FTPServer.Server.FTelnetServer := False;
FTPServer.ClientMaxIPs := 2;
FTPServer.ClientMaxIPs := bbsConfig.inetFTPDupes;
// FTPServer.TextPath := bbsConfig.DataPath;
Started := True;
@ -518,4 +518,4 @@ Begin
Console.Free;
Halt(255);
End.
End.

View File

@ -76,7 +76,6 @@ Type
Implementation
Const
FTPTimeOut = 120; // Make this configurabe in MCFG?
FileBufSize = 8 * 1024;
re_DataOpen = '125 Data connection already open';
@ -418,7 +417,7 @@ Var
WaitSock : TSocketClass;
Begin
If LoggedIn Then Begin
DataPort := Random(65535-60000) + 60000; // make configurable?!
DataPort := Random(bbsConfig.inetFTPPortMax - bbsConfig.inetFTPPortMin) + bbsConfig.inetFTPPortMin;
Client.WriteLine(re_PassiveOK + '(' + strReplace(Client.HostIP, '.', ',') + ',' + strI2S(WordRec(DataPort).Hi) + ',' + strI2S(WordRec(DataPort).Lo) + ').');
@ -712,7 +711,7 @@ Var
Begin
If LoggedIn Then Begin
If Data = '' Then Begin
DataPort := Random(65535 - 60000) + 60000; // make configuratable
DataPort := Random(bbsConfig.inetFTPPortMax - bbsConfig.inetFTPPortMin) + bbsConfig.inetFTPPortMin;
IsPassive := True;
Client.WriteLine('229 Entering Extended Passive Mode (|||' + strI2S(DataPort) + '|)');
@ -752,15 +751,12 @@ Begin
cmdREIN;
Repeat
If Client.WaitForData(FTPTimeOut * 1000) = 0 Then Break;
If Client.WaitForData(bbsConfig.inetFTPTimeout * 1000) = 0 Then Break;
If Terminated Then Exit;
If Client.ReadLine(Str) = -1 Then Exit;
// dlog(Str);
//server.server.status(str);
Cmd := strUpper(strWordGet(1, Str, ' '));
If Pos(' ', Str) > 0 Then