Skip to content

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

@fakevagrant

Description

@fakevagrant

在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;
}
解决了超时连接不能释放的问题,希望小彭老师修改一下

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions