From 2129e596a7efba41fd2ae9a0339a0b34953ef7d2 Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Tue, 29 Dec 2020 23:52:01 -0800
Subject: [PATCH] Remove 3 second delay before disconnecting when max clients
 reached

This seems to be misguided and would only increase the chances of a DoS-type attack on TCP session resources.

A second 3-second delay upon malloc failure is also removed.
---
 src/sbbs3/ftpsrvr.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c
index d632e1f721..ec003933be 100644
--- a/src/sbbs3/ftpsrvr.c
+++ b/src/sbbs3/ftpsrvr.c
@@ -5325,7 +5325,6 @@ void DLLCALL ftp_server(void* arg)
 				lprintf(LOG_WARNING,"%04d !MAXIMUM CLIENTS (%d) reached, access denied"
 					,client_socket, startup->max_clients);
 				sockprintf(client_socket,-1,"421 Maximum active clients reached, please try again later.");
-				mswait(3000);
 				ftp_close_socket(&client_socket,&none,__LINE__);
 				continue;
 			}
@@ -5334,7 +5333,6 @@ void DLLCALL ftp_server(void* arg)
 				lprintf(LOG_CRIT,"%04d !ERROR allocating %d bytes of memory for ftp_t"
 					,client_socket,(int)sizeof(ftp_t));
 				sockprintf(client_socket,-1,"421 System error, please try again later.");
-				mswait(3000);
 				ftp_close_socket(&client_socket,&none,__LINE__);
 				continue;
 			}
-- 
GitLab