From 96503967fcc1c9654deecac323c7c2c2e46e740e Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Fri, 11 Feb 2022 12:03:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E8=94=BDsendfile=E7=89=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpSession.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index 49260099..75f79a38 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -594,10 +594,13 @@ void HttpSession::sendResponse(int code, return; } +#if 0 + //sendfile跟共享mmap相比并没有性能上的优势,相反,sendfile还有功能上的缺陷,先屏蔽 if (typeid(*this) == typeid(HttpSession) && !body->sendFile(getSock()->rawFD())) { // http支持sendfile优化 return; } +#endif GET_CONFIG(uint32_t, sendBufSize, Http::kSendBufSize); if (body->remainSize() > sendBufSize) {