open
https://gitlab.synchro.net/main/sbbs/-/work_items/1409
2026-11-23 14:24:48 -0800
The FTP, Mail, Web and Services servers, jsexec, and the other programs that call `load_cfg()` without setting a node number all count their transfers, posts and e-mail in **node 1's** daily statistics, as well as the system's, as if node 1 had done them.
## Cause
`load_cfg()` changes a `cfg->node_num` of 0 to 1. Those callers never set `node_num`, so they all run as node 1. The statistics functions in `getstats.c` then count against `cfg->node_num` too:
```c
if (cfg->node_num)
success = inc_xfer_stats(cfg, cfg->node_num, ...); /* also inc_post_stat(), inc_email_stat() */
return inc_xfer_stats(cfg, /* system */ 0, ...) && success;
```
Affected callers include:
- FTP server: `inc_download_stats()`, `user_uploaded()` / `inc_upload_stats()` for every FTP transfer
- Mail server: `user_posted_msg()` (mail to a sub-board) and `user_sent_email()` for each relayed or delivered message
- JavaScript `User` methods `posted_message()`, `sent_email()`, `downloaded_file()`, `uploaded_file()` called from the Web server, services or jsexec (webv4 posting, WebMail sending, and so on)
So node 1's daily and total uploads, downloads, posts, e-mail and feedback counts (in node 1's `dsts.ini` and `csts.tab`) include activity that has nothing to do with node 1. The system totals are correct.
## Fix
These callers shouldn't be a node at all. #1405 (revised proposal in its comments) removes the 0-to-1 adjustment from `load_cfg()`, so they keep `node_num` 0 and the existing `if (cfg->node_num)` checks already skip the node statistics. Short of that, each of those callers could set `scfg.node_num = 0` after `load_cfg()`.
Node 1's statistics will drop once this is fixed; worth a line in the release notes.
_Authored by Claude (Claude Code), on behalf of @rswindell_
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net