mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-15 12:35:58 +08:00
尝试使用sendfile优化http文件服务器 (#1411)
This commit is contained in:
@@ -594,6 +594,11 @@ void HttpSession::sendResponse(int code,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!body->sendFile(getSock()->rawFD())) {
|
||||
//支持sendfile优化
|
||||
return;
|
||||
}
|
||||
|
||||
GET_CONFIG(uint32_t, sendBufSize, Http::kSendBufSize);
|
||||
if(body->remainSize() > sendBufSize){
|
||||
//文件下载提升发送性能
|
||||
|
||||
Reference in New Issue
Block a user