https://gitlab.synchro.net/main/sbbs/-/commit/093321f9486828a2a55865d0
Modified Files:
src/sbbs3/getnode.cpp main.cpp nopen.c src/smblib/smbfile.c smblib.c src/xpdev/filewrap.c filewrap.h
Log Message:
Don't retry a file open that failed for lack of permission (*nix)
A file the BBS can't write, such as a data/msgs/####.msg left owned by
root, made every logon hang about 28 seconds before the new-mail prompt. readsmsg() opens that file for read/write, and nopen() retried the
EACCES failure 100 times with a growing delay, then gave up without a
word, so the telegrams were never shown or cleared and the delay
recurred at every logon.
EACCES is retried because on Windows it is also what a sharing violation returns. On other systems an EACCES from open() is a permission error,
so retrying only adds the delay. FILE_OPEN_RETRY_ERRNO() is the set of
open failures worth retrying: on Windows the same as FILE_RETRY_ERRNO(), elsewhere without EACCES. nopen(), sbbs_t::nopen(), smb_open_fp() and smb_addcrc() use it. sopen() now reports a conflicting fcntl() lock as
EAGAIN (POSIX allows EACCES or EAGAIN), so a locked file is still waited
for. Read, write, chsize and lock retries keep FILE_RETRY_ERRNO(): through
a CIFS mount, a lock conflict on read() or write() comes back as EACCES.
getsmsg() now logs an error when telegrams are waiting but can't be read.
Measured with system.get_telegram() on an unwritable telegram file:
27.9 s before, 0.07 s after (27.8 s and 0.05 s through CIFS). A file
locked by another process for 4 s is still waited for, then read.
Fixes #1411
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net