Shutdown connection by server

This commit is contained in:
antao 2018-08-25 00:16:16 +08:00
parent d8bc8e27c9
commit 38a4175d8a
2 changed files with 5 additions and 5 deletions

View File

@ -163,10 +163,10 @@ void HttpServer::onRequest(const TcpConnectionPtr& conn, const HttpRequestPtr& r
MsgBuffer buf; MsgBuffer buf;
response.setCloseConnection(_close); response.setCloseConnection(_close);
((HttpResponseImpl &)response).appendToBuffer(&buf); ((HttpResponseImpl &)response).appendToBuffer(&buf);
conn->send(buf.peek(),buf.readableBytes()); conn->send(std::move(buf));
// if (response.closeConnection()) { if (_close) {
// conn->shutdown(); conn->shutdown();
// } }
}); });

@ -1 +1 @@
Subproject commit 3d8b0e2ad08ece49c471d0944d339e6aa20f8328 Subproject commit 0d18d03f0679234bec08efaa0f3a45cf3fe65834