Eliminate spurious expired timers in certain error conditions references #295

This commit is contained in:
Peter Thorson
2013-10-10 13:45:49 -05:00
parent 63cdaec0ba
commit 3d0d28affc
2 changed files with 12 additions and 10 deletions

View File

@@ -1,4 +1,6 @@
HEAD
- Eliminates spurious expired timers in certain error conditions. Thank you
Banaan for reporting. #295
- Consolidates all bundled library licenses into the COPYING file.
- Updates bundled sha1 library to one with a cleaner interface and more
straight-forward license.

View File

@@ -1177,6 +1177,11 @@ void connection<config>::handle_send_http_response(
this->log_open_result();
if (m_handshake_timer) {
m_handshake_timer->cancel();
m_handshake_timer.reset();
}
if (m_response.get_status_code() != http::status_code::switching_protocols)
{
if (m_processor) {
@@ -1193,11 +1198,6 @@ void connection<config>::handle_send_http_response(
return;
}
if (m_handshake_timer) {
m_handshake_timer->cancel();
m_handshake_timer.reset();
}
this->atomic_state_change(
istate::PROCESS_HTTP_REQUEST,
istate::PROCESS_CONNECTION,
@@ -1339,6 +1339,11 @@ void connection<config>::handle_read_http_response(const lib::error_code& ec,
m_alog.write(log::alevel::devel,std::string("Raw response: ")+m_response.raw());
if (m_response.headers_ready()) {
if (m_handshake_timer) {
m_handshake_timer->cancel();
m_handshake_timer.reset();
}
lib::error_code ec = m_processor->validate_server_handshake_response(
m_request,
m_response
@@ -1361,11 +1366,6 @@ void connection<config>::handle_read_http_response(const lib::error_code& ec,
"handle_read_http_response must be called from READ_HTTP_RESPONSE state"
);
if (m_handshake_timer) {
m_handshake_timer->cancel();
m_handshake_timer.reset();
}
this->log_open_result();
if (m_open_handler) {