co_async icon indicating copy to clipboard operation
co_async copied to clipboard

关于http连接超时之后不会清除连接的问题

Open fakevagrant opened this issue 6 months ago • 0 comments

在HTTPServer::doHandleConnection()这个函数中, 我将 /if (!co_await co_await io.readRequestHeader()) { break; }/

替换为: auto headerResult = co_await io.readRequestHeader(); if (headerResult.has_error() && headerResult.error() == std::errc::stream_timeout) { co_await io.extractSocket().close(); break; } 解决了超时连接不能释放的问题,希望小彭老师修改一下

fakevagrant avatar Jun 28 '25 09:06 fakevagrant