单个连接(fd)的安全与限流状态。
More...
#include <sttnet.h>
单个连接(fd)的安全与限流状态。
每个成功通过 allowConnect 的 fd 都会拥有一个 ConnectionState, 用于实现“连接级(fd 级)”防御:
- requestRate:该连接的整体请求速率限制
- pathRate:该连接在不同 path 下的额外限流状态
- lastActivity:该连接最后一次活动时间(用于僵尸连接检测)
- Note
-
◆ fd
| int stt::security::ConnectionState::fd = -1 |
◆ lastActivity
| std::chrono::steady_clock::time_point stt::security::ConnectionState::lastActivity {} |
◆ pathRate
| std::unordered_map<std::string, RateState> stt::security::ConnectionState::pathRate |
◆ requestRate
| RateState stt::security::ConnectionState::requestRate |
The documentation for this struct was generated from the following file: