From d5a2ef0a87e4af6b021b97b11a836fc498694553 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sun, 25 Jan 2009 09:25:08 +0000
Subject: [PATCH] Do not log warnings about graceful disconnections (e.g.
 hangup() is called).

---
 src/sbbs3/main.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index 94c0c39bd7..0ea0d0e917 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -1113,7 +1113,7 @@ void sbbs_t::js_create_user_objects(void)
 {
 	if(js_cx==NULL)
 		return;
-
+	
 	JS_BEGINREQUEST(js_cx);
 	if(!js_CreateUserObjects(js_cx, js_glob, &cfg, &useron, NULL, subscan)) 
 		lprintf(LOG_ERR,"!JavaScript ERROR creating user objects");
@@ -1572,6 +1572,8 @@ void input_thread(void *arg)
 #ifdef __unix__
 			if(sock==sbbs->client_socket)  {
 #endif
+				if(!sbbs->online)	// sbbs_t::hangup() called?
+					break;
 	        	if(ERROR_VALUE == ENOTSOCK)
     	            lprintf(LOG_NOTICE,"Node %d socket closed by peer on receive", sbbs->cfg.node_num);
         	    else if(ERROR_VALUE==ECONNRESET) 
@@ -3494,6 +3496,10 @@ int sbbs_t::mv(char *src, char *dest, char copy)
 
 void sbbs_t::hangup(void)
 {
+	if(online) {
+		lprintf(LOG_DEBUG,"Node %d disconnecting client", cfg.node_num);
+		online=FALSE;	// moved from the bottom of this fucntion on Jan-25-2009
+	}
 	if(client_socket_dup!=INVALID_SOCKET && client_socket_dup!=client_socket)
 		closesocket(client_socket_dup);
 	client_socket_dup=INVALID_SOCKET;
@@ -3505,7 +3511,6 @@ void sbbs_t::hangup(void)
 		client_socket=INVALID_SOCKET;
 	}
 	sem_post(&outbuf.sem);
-	online=FALSE;
 }
 
 int sbbs_t::incom(unsigned long timeout)
-- 
GitLab