diff options
-rw-r--r-- | include/http_connection.h | 10 |
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(); |