https://gitlab.synchro.net/main/sbbs/-/commit/3592004a31ca096b15faeafd
Modified Files:
docs/v322_new.md src/sbbs3/ftpsrvr.cpp mailsrvr.cpp main.cpp websrvr.cpp src/xpdev/multisock.c multisock.h
Log Message:
Close server listening sockets as soon as shutdown begins
The terminal, mail, FTP, and web servers kept their listening sockets open until cleanup(), which runs only after the wait for active clients and
child threads. Nothing calls accept() during that wait, but the kernel
still completes TCP handshakes into the listen backlog, so every client
that connected during a shutdown or recycle sat on an unanswered
connection until the sockets finally closed, then got a reset. On a busy
web server that drain can last two minutes.
Add xpms_close() to xpdev, which closes a set's sockets but leaves the set allocated, and call it in each server right after its accept loop exits. xpms_destroy() now uses it. The set must stay allocated rather than being destroyed early because the FTP transfer threads treat ftp_set == NULL as "server torn down": clearing it at the start of a recycle would abort in-progress transfers. The services server already closed its sockets at
this point.
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net