Skip to content

Commit

Permalink
move this up a bit to ignore response status code
Browse files Browse the repository at this point in the history
  • Loading branch information
zaphoyd committed Dec 16, 2014
1 parent 0a879a6 commit 9636277
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions websocketpp/impl/connection_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1210,18 +1210,18 @@ template <typename config>
void connection<config>::send_http_response(lib::error_code const & ec) {
m_alog.write(log::alevel::devel,"connection send_http_response");

if (m_ec == error::make_error_code(error::http_connection_ended) {
m_alog.write(log::alevel::http,"An HTTP handler took over the connection.");
return;
}

if (m_response.get_status_code() == http::status_code::uninitialized) {
m_response.set_status(http::status_code::internal_server_error);
m_ec = error::make_error_code(error::general);
} else {
m_ec = ec;
}

if (m_ec == error::make_error_code(error::http_connection_ended) {
m_alog.write(log::alevel::http,"An HTTP handler took over the connection.");
return;
}

m_response.set_version("HTTP/1.1");

// Set server header based on the user agent settings
Expand Down

0 comments on commit 9636277

Please sign in to comment.