fix(libhttp): 服务器读超时防 Slowloris (P1-4)
- 新增 setHeaderTimeout()(default 10s) / setReadTimeout()(default 30s),对齐 WAF - doSSLHandshake 设置头超时覆盖握手,doRead 拆分为 async_read_header (头超时) + async_read (体超时) - doWsRead 每次读取设置空闲超时,自动清理长期空闲连接 - 更新审计文档 P1-4 状态、README v3.4.2
This commit is contained in:
1 parent
507054c4b2
commit
37c6d401d6
6 files changed
+64
-4
No files matched your search
@@ -74,6 +74,9 @@ void HttpServer::Session::doWsRead() {
|
||||
auto self = shared_from_this();
|
||||
ws_buffer_.consume(ws_buffer_.size());
|
||||
|
||||
// P1-4:WS 读取设置空闲超时,清理长期不发消息的连接
|
||||
stream_.expires_after(server_->getReadTimeout());
|
||||
|
||||
if (ssl_enabled_ && wss_stream_) {
|
||||
wss_stream_->async_read(
|
||||
ws_buffer_,
|
||||
|
||||
Reference in new issue
Block a user