]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Feature] Fuzzy storage: implement TCP protocol support
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 7 Oct 2025 07:56:32 +0000 (08:56 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 7 Oct 2025 07:56:32 +0000 (08:56 +0100)
commit943668cd59ca248fae035513e263d163de4f88f2
tree4bec754791df2e012be5768473566842f818d8b1
parent901ef50bbb750c694965a714e65f8744fdb520a6
[Feature] Fuzzy storage: implement TCP protocol support

Implement TCP transport for fuzzy storage protocol to enable efficient
bulk request handling. This adds TCP accept handlers, frame-based I/O
processing, and proper session management.

Changes:
- Add TCP session structure with framing state machine
- Implement TCP accept handler with rate limiting and access control
- Add TCP I/O handler supporting frame-based protocol (size header + payload)
- Implement TCP write reply with queuing support
- Add TCP timeout configuration parameter (default: 5.0 seconds)
- Refactor rate limit checks to accept parameters instead of session objects
- Update worker socket type to support both UDP and TCP
- Add debug logging infrastructure for fuzzy storage

TCP framing protocol: [uint16_t size][encrypted_payload]
Frame processing uses state machine: 0x0000 (idle) -> 0x8000 (have size) -> 0xC000 (complete)
src/fuzzy_storage.c