Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

I don't understand the HUMOUR of the THREE STOOGES!!


dovenet / Synchronet Programming / src/sbbs3/main.cpp

SubjectAuthor
o src/sbbs3/main.cppRob Swindell (on Windows)

1
src/sbbs3/main.cpp

<647A8E30.47269.syncprog@vert.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=1270&group=DOVE-Net.Synchronet_Programming#1270

  copy link   Newsgroups: DOVE-Net.Synchronet_Programming
From: rob.swindell.(on.windows)@VERT (Rob Swindell (on Windows))
To: Git commit to main/sbbs/master
Subject: src/sbbs3/main.cpp
Message-ID: <647A8E30.47269.syncprog@vert.synchro.net>
Date: Fri, 2 Jun 2023 17:49:52 -0700
X-Comment-To: Git commit to main/sbbs/master
Path: rocksolidbbs.com!not-for-mail
Organization: Vertrauen
Newsgroups: DOVE-Net.Synchronet_Programming
X-FTN-PID: Synchronet 3.20a-Linux master/c54591d6e Jun 1 2023 GCC 12.2.0
X-FTN-MSGID: 47269.syncprog@1:103/705 28e07cd5
X-FTN-CHRS: CP437 2
WhenImported: 20230602174952-0700 c1e0
WhenExported: 20230603081429-0700 c1e0
ExportedFrom: VERT syncprog 47269
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Rob Swindell (on Win - Sat, 3 Jun 2023 00:49 UTC

https://gitlab.synchro.net/main/sbbs/-/commit/ca7ab040466b030281a9aaca
Modified Files:
src/sbbs3/main.cpp
Log Message:
Add a 60-second timeout to sbbs_t::passthru_socket_activate()

Keyop reported an issue via irc whereby a user that failed to download a file
would leave the node "hung" in "downloading via telnet" node status even
though the user had long since disconnected and the log reflected that the
terminal server was aware of this:

term Node 4 <user> sexyz: !1152 zmodem_recv_raw TIMEOUT (10 seconds)
term Node 4 <user> sexyz: !zmodem_recv_header TIMEOUT
term Node 4 <user> external Timeout waiting for output buffer to empty
<minutes later>
term Node 4 connection reset by peer on send
term Node 4 !ERROR 32 sending on socket 102
term Node 4 !ERROR 32 sending on socket 102
term Node 4 !ERROR 32 sending on socket 102
term Node 4 !ERROR 32 sending on socket 102
term Node 4 !ERROR 32 sending on socket 102
term Node 4 disconnected
term Node 4 !ERROR 32 sending on socket 102

and

term Node 3 <user> sexyz: !1152 zmodem_recv_raw TIMEOUT (10 seconds)
term Node 3 <user> sexyz: !zmodem_recv_header TIMEOUT
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !Receive timeout (1 seconds)
term Node 3 <user> sexyz: !1152 zmodem_recv_raw TIMEOUT (10 seconds)
term Node 3 <user> sexyz: !zmodem_recv_header TIMEOUT
term Node 3 <user> external Timeout waiting for output buffer to empty
<minutes later>
term Node 3 connection reset by peer on receive
term Node 3 !ERROR 32 sending on socket 96

These nodes were then locked up in call to passthru_socket_activate(false)
as reported by gdb, e.g.

Looking at passthru_socket_activate(), the deactivation path (called at the
end of external() in this case), it was clear that this could be an infinite
loop in the case the user had disconnected:

do { // Allow time for the passthru_thread to move any pending socket data to the outbuf
SLEEP(100); // Before the node_thread starts sending its own data to the outbuf
} while(RingBufFull(&outbuf));

These flush/purge loops aren't strictly needed if the user has disconnected,
but as can be seen by the above logs, the terminal server may not know that
(the socket may not indicate disconnect) before passthru_socket_activate()
is called by external().

So... worst case, just do the activation and deactivation buffer flushes
and purges for 60 seconds.

---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net


dovenet / Synchronet Programming / src/sbbs3/main.cpp

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor