From 38a4175d8a1ea0860c330905947b54151857ac00 Mon Sep 17 00:00:00 2001 From: antao Date: Sat, 25 Aug 2018 00:16:16 +0800 Subject: [PATCH] Shutdown connection by server --- lib/src/HttpServer.cc | 8 ++++---- trantor | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/HttpServer.cc b/lib/src/HttpServer.cc index 0248affd..00bd9df3 100755 --- a/lib/src/HttpServer.cc +++ b/lib/src/HttpServer.cc @@ -163,10 +163,10 @@ void HttpServer::onRequest(const TcpConnectionPtr& conn, const HttpRequestPtr& r MsgBuffer buf; response.setCloseConnection(_close); ((HttpResponseImpl &)response).appendToBuffer(&buf); - conn->send(buf.peek(),buf.readableBytes()); -// if (response.closeConnection()) { -// conn->shutdown(); -// } + conn->send(std::move(buf)); + if (_close) { + conn->shutdown(); + } }); diff --git a/trantor b/trantor index 3d8b0e2a..0d18d03f 160000 --- a/trantor +++ b/trantor @@ -1 +1 @@ -Subproject commit 3d8b0e2ad08ece49c471d0944d339e6aa20f8328 +Subproject commit 0d18d03f0679234bec08efaa0f3a45cf3fe65834