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

View File

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