https://gitlab.synchro.net/main/sbbs/-/commit/07131d6e58343813ead2e885
Modified Files:
xtrn/wttr.in/locator.js
Log Message:
Read the WebSocket relay's sidecar file a line at a time
websocketservice.js writes <temp_dir>/sbbs-ws-<port>.ip so a backend can recover the real client address from behind the relay, and that file now carries a second line -- the authenticated web user. xtrn/wttr.in's
locator.js read it with File.read(), which reads to EOF, so it got both
lines back joined by a CRLF and returned that as the client's address.
It then goes out as part of an HTTP request line and as a cache key.
readln() is the correct read here regardless: the value wanted is the
first line, and it was only ever safe to slurp the file while the file
happened to hold nothing else. It strips the trailing CR, so no CRLF
survives into the address. A truncated read now returns early rather
than throwing, since the relay's open('w') empties the file before
writing it and a reader can land in that window.
Correct the comment above the write, too. It said any existing backend
still read exactly the first line; the address is indeed still the first
line, but that is a statement about the file and not about its readers,
and the reader in this tree was not one.
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net