From 3d957b2b6b5da921f10928ce9962b39488b44bf9 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Mon, 3 Mar 2003 05:53:13 +0000
Subject: [PATCH] Silently-filtered IP address (using ip-silent.can) are truely
 silent now (no sounds or log entries).

---
 src/sbbs3/ftpsrvr.c  | 11 +++++------
 src/sbbs3/mailsrvr.c | 22 ++++++++++------------
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/src/sbbs3/ftpsrvr.c b/src/sbbs3/ftpsrvr.c
index df30b36e32..a3f9240733 100644
--- a/src/sbbs3/ftpsrvr.c
+++ b/src/sbbs3/ftpsrvr.c
@@ -2403,12 +2403,6 @@ static void ctrl_thread(void* arg)
 
 	SAFECOPY(host_ip,inet_ntoa(ftp.client_addr.sin_addr));
 
-	if(trashcan(&scfg,host_ip,"ip-silent")) {
-		ftp_close_socket(&sock,__LINE__);
-		thread_down();
-		return;
-	}
-
 	lprintf ("%04d CTRL connection accepted from: %s port %u"
 		,sock, host_ip, ntohs(ftp.client_addr.sin_port));
 
@@ -4713,6 +4707,11 @@ void DLLCALL ftp_server(void* arg)
 				startup->socket_open(TRUE);
 			sockets++;
 
+			if(trashcan(&scfg,inet_ntoa(client_addr.sin_addr),"ip-silent")) {
+				ftp_close_socket(&client_socket,__LINE__);
+				continue;
+			}
+
 			if(active_clients>=startup->max_clients) {
 				lprintf("%04d !MAXMIMUM CLIENTS (%d) reached, access denied"
 					,client_socket, startup->max_clients);
diff --git a/src/sbbs3/mailsrvr.c b/src/sbbs3/mailsrvr.c
index 7c5f2fe0fc..048d4cccd3 100644
--- a/src/sbbs3/mailsrvr.c
+++ b/src/sbbs3/mailsrvr.c
@@ -658,12 +658,6 @@ static void pop3_thread(void* arg)
 
 	SAFECOPY(host_ip,inet_ntoa(pop3.client_addr.sin_addr));
 
-	if(trashcan(&scfg,host_ip,"ip-silent")) {
-		mail_close_socket(socket);
-		thread_down();
-		return;
-	}
-
 	if(startup->options&MAIL_OPT_DEBUG_POP3)
 		lprintf("%04d POP3 connection accepted from: %s port %u"
 			,socket, host_ip, ntohs(pop3.client_addr.sin_port));
@@ -1495,12 +1489,6 @@ static void smtp_thread(void* arg)
 
 	SAFECOPY(host_ip,inet_ntoa(smtp.client_addr.sin_addr));
 
-	if(trashcan(&scfg,host_ip,"ip-silent")) {
-		mail_close_socket(socket);
-		thread_down();
-		return;
-	}
-
 	lprintf("%04d SMTP connection accepted from: %s port %u"
 		, socket, host_ip, ntohs(smtp.client_addr.sin_port));
 
@@ -3461,6 +3449,11 @@ void DLLCALL mail_server(void* arg)
 					startup->socket_open(TRUE);
 				sockets++;
 
+				if(trashcan(&scfg,inet_ntoa(client_addr.sin_addr),"ip-silent")) {
+					mail_close_socket(client_socket);
+					continue;
+				}
+
 				if(active_clients>=startup->max_clients) {
 					lprintf("%04d !MAXMIMUM CLIENTS (%u) reached, access denied"
 						,client_socket, startup->max_clients);
@@ -3511,6 +3504,11 @@ void DLLCALL mail_server(void* arg)
 					startup->socket_open(TRUE);
 				sockets++;
 
+				if(trashcan(&scfg,inet_ntoa(client_addr.sin_addr),"ip-silent")) {
+					mail_close_socket(client_socket);
+					continue;
+				}
+
 				if(active_clients>=startup->max_clients) {
 					lprintf("%04d !MAXMIMUM CLIENTS (%u) reached, access denied"
 						,client_socket, startup->max_clients);
-- 
GitLab