From 3344e8f82421f2b248155fa9d5f313f4482178d2 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 8 Oct 2014 18:45:01 -0400 Subject: [PATCH] delete HTTP connection if closed --- HTTPServer.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/HTTPServer.cpp b/HTTPServer.cpp index da40285a..1d19dd14 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -544,8 +544,8 @@ namespace util m_Stream->Send ((uint8_t *)m_Buffer, bytes_transferred); Receive (); } - /*else if (ecode != boost::asio::error::operation_aborted) - Terminate ();*/ + else if (ecode != boost::asio::error::operation_aborted) + Terminate (); } void HTTPConnection::RunRequest () @@ -600,13 +600,17 @@ namespace util void HTTPConnection::HandleWriteReply (const boost::system::error_code& ecode) { - Terminate (); + if (ecode != boost::asio::error::operation_aborted) + Terminate (); } void HTTPConnection::HandleWrite (const boost::system::error_code& ecode) { if (ecode || (m_Stream && !m_Stream->IsOpen ())) - Terminate (); + { + if (ecode != boost::asio::error::operation_aborted) + Terminate (); + } else // data keeps coming AsyncStreamReceive (); } @@ -883,7 +887,7 @@ namespace util { if (ecode == boost::asio::error::timed_out) SendReply ("" + itoopieImage + "
Not responding", 504); - else + else if (ecode != boost::asio::error::operation_aborted) Terminate (); } }