aboutsummaryrefslogtreecommitdiffstats
path: root/http_connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'http_connection.h')
-rw-r--r--http_connection.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/http_connection.h b/http_connection.h
index d5ee1c9..2f245ba 100644
--- a/http_connection.h
+++ b/http_connection.h
@@ -69,11 +69,22 @@ namespace flask
if (!ec)
{
bool ret = parser_.feed(buffer_.data(), bytes_transferred);
- do_read();
+ if (ret)
+ do_read();
+ else
+ {
+ socket_.close();
+
+ life_--;
+ if ((int)life_ == 0)
+ {
+ delete this;
+ }
+ }
}
else
{
- bool ret = parser_.done();
+ parser_.done();
socket_.close();
life_--;