aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2016-09-10 02:13:50 +0900
committeripknHama <ipknhama@gmail.com>2016-09-10 02:13:50 +0900
commitd07a26f3f8fbbc02f539721bfed1e3191a8154b3 (patch)
treef0f4af9e4db3df3633a722dd828866d281bdf058 /include
parent7d428f42650ca840cfca4d98ca107b87e3891bcd (diff)
downloadcrow-d07a26f3f8fbbc02f539721bfed1e3191a8154b3.tar.gz
crow-d07a26f3f8fbbc02f539721bfed1e3191a8154b3.zip
Closing behavior change; should help #151
Diffstat (limited to 'include')
-rw-r--r--include/http_connection.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/http_connection.h b/include/http_connection.h
index 5517521..e8eb4b1 100644
--- a/include/http_connection.h
+++ b/include/http_connection.h
@@ -467,7 +467,7 @@ namespace crow
if (!ec)
{
bool ret = parser_.feed(buffer_.data(), bytes_transferred);
- if (ret && adaptor_.is_open() && !close_connection_)
+ if (ret && adaptor_.is_open())
{
error_while_reading = false;
}
@@ -482,6 +482,14 @@ namespace crow
CROW_LOG_DEBUG << this << " from read(1)";
check_destroy();
}
+ else if (close_connection_)
+ {
+ cancel_deadline_timer();
+ parser_.done();
+ is_reading = false;
+ check_destroy();
+ // adaptor will close after write
+ }
else if (!need_to_call_after_handlers_)
{
start_deadline();