Repository: trafficserver Updated Branches: refs/heads/master 8fbd137a9 -> a56319eee
[TS-3035] - fix duplicate logging on error transactions Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a56319ee Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a56319ee Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a56319ee Branch: refs/heads/master Commit: a56319eee7556c10c7f473ab2b4a5fe1907025c8 Parents: 8fbd137 Author: Sudheer Vinukonda <sudhe...@yahoo-inc.com> Authored: Fri Sep 12 16:59:39 2014 +0000 Committer: Sudheer Vinukonda <sudhe...@yahoo-inc.com> Committed: Fri Sep 12 16:59:39 2014 +0000 ---------------------------------------------------------------------- proxy/http/HttpBodyFactory.cc | 4 +--- proxy/http/HttpSM.cc | 38 ++++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a56319ee/proxy/http/HttpBodyFactory.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpBodyFactory.cc b/proxy/http/HttpBodyFactory.cc index e7f9703..33e273e 100644 --- a/proxy/http/HttpBodyFactory.cc +++ b/proxy/http/HttpBodyFactory.cc @@ -1009,9 +1009,7 @@ HttpBodyTemplate::build_instantiated_buffer(HttpTransact::State * context, int64 LogAccessHttp la(context->state_machine); - // TODO: Should we check the return code from Log::access() ? - Log::access(&la); - buffer = resolve_logfield_string((LogAccess *) & la, template_buffer); + buffer = resolve_logfield_string(& la, template_buffer); *buflen_return = ((buffer == NULL) ? 0 : strlen(buffer)); Debug("body_factory_instantiation", " after instantiation: [%s]", buffer); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a56319ee/proxy/http/HttpSM.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 2e54c32..1813380 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -6539,10 +6539,29 @@ HttpSM::kill_this() ink_release_assert(vc_table.is_table_clear() == true); ink_release_assert(tunnel.is_tunnel_active() == false); + HTTP_SM_SET_DEFAULT_HANDLER(NULL); + if (t_state.http_config_param->enable_http_stats) update_stats(); - HTTP_SM_SET_DEFAULT_HANDLER(NULL); + if (!t_state.cop_test_page || t_state.http_config_param->record_cop_page) { + ////////////// + // Log Data // + ////////////// + DebugSM("http_seq", "[HttpSM::update_stats] Logging transaction"); + if (Log::transaction_logging_enabled() && t_state.api_info.logging_enabled) { + LogAccessHttp accessor(this); + + int ret = Log::access(&accessor); + + if (ret & Log::FULL) { + DebugSM("http", "[update_stats] Logging system indicates FULL."); + } + if (ret & Log::FAIL) { + Log::error("failed to log transaction for at least one log object"); + } + } + } if (redirect_url != NULL) { ats_free((void*)redirect_url); @@ -6572,23 +6591,6 @@ HttpSM::update_stats() return; } - ////////////// - // Log Data // - ////////////// - DebugSM("http_seq", "[HttpSM::update_stats] Logging transaction"); - if (Log::transaction_logging_enabled() && t_state.api_info.logging_enabled) { - LogAccessHttp accessor(this); - - int ret = Log::access(&accessor); - - if (ret & Log::FULL) { - DebugSM("http", "[update_stats] Logging system indicates FULL."); - } - if (ret & Log::FAIL) { - Log::error("failed to log transaction for at least one log object"); - } - } - if (is_action_tag_set("bad_length_state_dump")) { if (t_state.hdr_info.client_response.valid() && t_state.hdr_info.client_response.status_get() == HTTP_STATUS_OK) { int64_t p_resp_cl = t_state.hdr_info.client_response.get_content_length();