From d83641a8a2eb9be243f25a05f7ac54dd94ce3db5 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sun, 1 Dec 2002 01:18:26 +0000
Subject: [PATCH] Fixed bug: the UDP flag wasn't be reset, so if a system
 responded via UDP during the first listing, it would only be polled via UDP
 from then on.

---
 exec/sbbsimsg.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/exec/sbbsimsg.js b/exec/sbbsimsg.js
index e7ab696b4d..961255513a 100644
--- a/exec/sbbsimsg.js
+++ b/exec/sbbsimsg.js
@@ -133,7 +133,7 @@ function parse_response(response, show)
 function list_users(show)
 {
 	imsg_user = new Array();
-	var systems=0;
+	var udp_req=0;
 	var replies=0;
 
 	users = 0;
@@ -141,6 +141,8 @@ function list_users(show)
 	print("\1m\1hListing Systems and Users (Ctrl-C to Abort)...");
 
 	/* UDP systems */
+	for(i=0;sys[i]!=undefined;i++)
+		sys[i].udp=false;	// Reset the udp flag
 	sock = new Socket(SOCK_DGRAM);
 	//sock.debug=true;
 	sock.bind();
@@ -150,11 +152,11 @@ function list_users(show)
 		if(!sock.sendto("\r\n",sys[i].ip,79))	// Get list of active users
 			//printf("FAILED! (%d) Sending to %s\r\n",sock.last_error,sys[i].addr);
 			continue;
-		systems++;
+		udp_req++;
 	}
 
 	begin = new Date();
-	while(replies<systems && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT)
+	while(replies<udp_req && new Date().valueOf()-begin.valueOf() < UDP_RESPONSE_TIMEOUT)
 	{
 
 		if(!sock.poll(1))
-- 
GitLab