move this up a bit to ignore response status code

This commit is contained in:
Peter Thorson committed 2014-12-16 06:36:34 -05:00
1 parent 0a879a6dc2
commit 96362774a3
1 file changed
+5 -5
+5 -5
View File
@@ -1210,6 +1210,11 @@ 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);
@@ -1217,11 +1222,6 @@ void connection<config>::send_http_response(lib::error_code const & ec) {
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