You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2019/07/03 02:51:11 UTC

[trafficserver] 01/01: Print error code as hex decimal

This is an automated email from the ASF dual-hosted git repository.

maskit pushed a commit to branch h2_log_errors_with_code
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 37f5b33cef71f9104692174e49f720d3f1b8abe0
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Wed Jul 3 11:50:14 2019 +0900

    Print error code as hex decimal
---
 proxy/http2/Http2ConnectionState.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 94d49ac..692544f 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -970,8 +970,8 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
       const char *client_ip = ats_ip_ntop(ua_session->get_client_addr(), ipb, sizeof(ipb));
       if (error.cls == Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION) {
         if (error.msg) {
-          Error("HTTP/2 connection error code=%d client_ip=%s session_id=%" PRId64 " stream_id=%u %s", static_cast<int>(error.code),
-                client_ip, ua_session->connection_id(), stream_id, error.msg);
+          Error("HTTP/2 connection error code=0x%0x client_ip=%s session_id=%" PRId64 " stream_id=%u %s",
+                static_cast<int>(error.code), client_ip, ua_session->connection_id(), stream_id, error.msg);
         }
         this->send_goaway_frame(this->latest_streamid_in, error.code);
         this->ua_session->set_half_close_local_flag(true);
@@ -983,7 +983,7 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
         // The Http2ClientSession will shutdown because connection_state.is_state_closed() will be true
       } else if (error.cls == Http2ErrorClass::HTTP2_ERROR_CLASS_STREAM) {
         if (error.msg) {
-          Error("HTTP/2 stream error code=%d client_ip=%s session_id=%" PRId64 " stream_id=%u %s", static_cast<int>(error.code),
+          Error("HTTP/2 stream error code=0x%0x client_ip=%s session_id=%" PRId64 " stream_id=%u %s", static_cast<int>(error.code),
                 client_ip, ua_session->connection_id(), stream_id, error.msg);
         }
         this->send_rst_stream_frame(stream_id, error.code);