Browse Source

delete HTTP connection if closed

pull/102/head
orignal 10 years ago
parent
commit
3344e8f824
  1. 14
      HTTPServer.cpp

14
HTTPServer.cpp

@ -544,8 +544,8 @@ namespace util
m_Stream->Send ((uint8_t *)m_Buffer, bytes_transferred); m_Stream->Send ((uint8_t *)m_Buffer, bytes_transferred);
Receive (); Receive ();
} }
/*else if (ecode != boost::asio::error::operation_aborted) else if (ecode != boost::asio::error::operation_aborted)
Terminate ();*/ Terminate ();
} }
void HTTPConnection::RunRequest () void HTTPConnection::RunRequest ()
@ -600,13 +600,17 @@ namespace util
void HTTPConnection::HandleWriteReply (const boost::system::error_code& ecode) 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) void HTTPConnection::HandleWrite (const boost::system::error_code& ecode)
{ {
if (ecode || (m_Stream && !m_Stream->IsOpen ())) if (ecode || (m_Stream && !m_Stream->IsOpen ()))
Terminate (); {
if (ecode != boost::asio::error::operation_aborted)
Terminate ();
}
else // data keeps coming else // data keeps coming
AsyncStreamReceive (); AsyncStreamReceive ();
} }
@ -883,7 +887,7 @@ namespace util
{ {
if (ecode == boost::asio::error::timed_out) if (ecode == boost::asio::error::timed_out)
SendReply ("<html>" + itoopieImage + "<br>Not responding</html>", 504); SendReply ("<html>" + itoopieImage + "<br>Not responding</html>", 504);
else else if (ecode != boost::asio::error::operation_aborted)
Terminate (); Terminate ();
} }
} }

Loading…
Cancel
Save