仅http协议开启sendfile优化

This commit is contained in:
xiongziliang 2022-02-05 01:00:48 +08:00
parent d13e31c21b
commit 4505f8ff4f

View File

@ -594,8 +594,8 @@ void HttpSession::sendResponse(int code,
return;
}
if (!body->sendFile(getSock()->rawFD())) {
//支持sendfile优化
if (typeid(*this) == typeid(HttpSession) && !body->sendFile(getSock()->rawFD())) {
//http支持sendfile优化
return;
}