• src/sbbs3/ratelimit.hpp

    From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Tuesday, April 07, 2026 20:00:11
    https://gitlab.synchro.net/main/sbbs/-/commit/e57ac918b88b43e39f7baa9b
    Modified Files:
    src/sbbs3/ratelimit.hpp
    Log Message:
    Mutex-protect the map (the client IP/count dataset)

    Although this has been running for months without issue on multiple servers
    for vert/www/git.synchro.net, I did observe *a* (one) crash that let me know this could ultimately fail in the exact right circumstances.

    Although the use of std::mutex caused issues (crashes) when used in filterFile and older MSVC++ runtime libs, it appears to be fine when used in this class: no crash observed when run on Windows 7.

    Fix issue #1113
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Friday, May 22, 2026 01:28:50
    https://gitlab.synchro.net/main/sbbs/-/commit/9cff8ce6526b0dba6edc1442
    Modified Files:
    src/sbbs3/ratelimit.hpp
    Log Message:
    ratelimit: use pthread_mutex_t instead of std::mutex (issue #1089)

    The std::mutex added in e57ac918b ("Mutex-protect the map") carries the same latent crash that filterfile.hpp hit: std::mutex/std::lock_guard crash in MSVCP140.dll with older MSVC++ runtime libraries (issue #1089). Apply the same remedy used for filterfile.hpp in fb6c6aadd: an explicitly-initialized pthread_mutex_t (init in constructor, destroy in destructor), explicit lock/unlock (each method restructured to a single return), and deleted copy/assignment.

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)