From 3389aadcb8d3bcc3b428b9934c00a8e829a3a484 Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Mon, 28 Nov 2022 11:01:10 -0800
Subject: [PATCH] Revert "Check socket writability in JS Socket.send()"

This reverts commit f0127e9d4572f8c1c44536dcda240c310e18f7d8.

This change was "wrong-headed" per Deuce and broke JS sends on
blocking sockets. Thanks for the help.

This fix for inifinite-wait on send() likely led to the infinite
BinkIT errors/log messages that led to commit 4dd32231.

The real fix for this problem (which can block all other timed
events from running), would be a Socket.poll() on the socket before
send in binkp.js.
---
 src/sbbs3/js_socket.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/sbbs3/js_socket.c b/src/sbbs3/js_socket.c
index 10e168177b..8426006c8c 100644
--- a/src/sbbs3/js_socket.c
+++ b/src/sbbs3/js_socket.c
@@ -337,12 +337,8 @@ static ptrdiff_t js_socket_sendsocket(js_socket_private_t *p, const void *msg, s
 	int copied=0,ret;
 	char *estr;
 
-	if(p->session==-1) {
-		BOOL wr = FALSE;
-		if(!socket_check(p->sock, NULL, &wr, 0) || !wr)
-			return 0;
+	if(p->session==-1)
 		return sendsocket(p->sock, msg, len);
-	}
 	do {
 		// If we don't limit this, we occasionally get errors on large sends...
 		if((ret=cryptPushData(p->session, msg, len > 0x2000 ? 0x2000 : len, &copied))==CRYPT_OK) {
-- 
GitLab