Fix documentation, add request-is-ssl (cqssl) log tag I'm usualy not fan of amending a branch to introduce new feature, but this one worth it, as it relies directly on the code path (dynamic_cast) introduced to fix TS-3683. Additionnaly it is related to improve measurements and related to SSL as well.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0413469c Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0413469c Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0413469c Branch: refs/heads/master Commit: 0413469cfa982308779807ed7ba72f69348c3d93 Parents: e7c0cab Author: Francois Pesce <[email protected]> Authored: Fri Jun 26 06:12:50 2015 -0700 Committer: Francois Pesce <[email protected]> Committed: Fri Jun 26 06:12:50 2015 -0700 ---------------------------------------------------------------------- doc/admin/event-logging-formats.en.rst | 6 ++++++ doc/reference/api/TSNetVConnSSLCachedHitSet.en.rst | 2 +- proxy/http/HttpSM.cc | 10 ++++++---- proxy/http/HttpSM.h | 1 + proxy/logging/Log.cc | 5 +++++ proxy/logging/LogAccess.cc | 9 +++++++++ proxy/logging/LogAccess.h | 1 + proxy/logging/LogAccessHttp.cc | 14 ++++++++++++++ proxy/logging/LogAccessHttp.h | 1 + 9 files changed, 44 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0413469c/doc/admin/event-logging-formats.en.rst ---------------------------------------------------------------------- diff --git a/doc/admin/event-logging-formats.en.rst b/doc/admin/event-logging-formats.en.rst index 1b14d55..5529638 100644 --- a/doc/admin/event-logging-formats.en.rst +++ b/doc/admin/event-logging-formats.en.rst @@ -176,6 +176,12 @@ The following list describes Traffic Server custom logging fields. The TCP reused status; indicates if this request went through an already established connection. +.. _cqssl: + +``cqssl`` + The SSL client request status indicates if this client connection + is over SSL. + .. _cqssr: ``cqssr`` http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0413469c/doc/reference/api/TSNetVConnSSLCachedHitSet.en.rst ---------------------------------------------------------------------- diff --git a/doc/reference/api/TSNetVConnSSLCachedHitSet.en.rst b/doc/reference/api/TSNetVConnSSLCachedHitSet.en.rst index 64ad686..e98c550 100644 --- a/doc/reference/api/TSNetVConnSSLCachedHitSet.en.rst +++ b/doc/reference/api/TSNetVConnSSLCachedHitSet.en.rst @@ -15,7 +15,7 @@ permissions and limitations under the License. -TSVConnIsSsl +TSNetVConnSSLCachedHitSet ============ Synopsis http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0413469c/proxy/http/HttpSM.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index f246382..6df8d30 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -276,9 +276,9 @@ HttpSM::HttpSM() client_request_hdr_bytes(0), client_request_body_bytes(0), server_request_hdr_bytes(0), server_request_body_bytes(0), server_response_hdr_bytes(0), server_response_body_bytes(0), client_response_hdr_bytes(0), client_response_body_bytes(0), cache_response_hdr_bytes(0), cache_response_body_bytes(0), pushed_response_hdr_bytes(0), pushed_response_body_bytes(0), - client_tcp_reused(false), client_ssl_reused(false), plugin_tag(0), plugin_id(0), hooks_set(false), - cur_hook_id(TS_HTTP_LAST_HOOK), cur_hook(NULL), cur_hooks(0), callout_state(HTTP_API_NO_CALLOUT), terminate_sm(false), - kill_this_async_done(false), parse_range_done(false) + client_tcp_reused(false), client_ssl_reused(false), client_connection_is_ssl(false), plugin_tag(0), plugin_id(0), + hooks_set(false), cur_hook_id(TS_HTTP_LAST_HOOK), cur_hook(NULL), cur_hooks(0), callout_state(HTTP_API_NO_CALLOUT), + terminate_sm(false), kill_this_async_done(false), parse_range_done(false) { memset(&history, 0, sizeof(history)); memset(&vc_table, 0, sizeof(vc_table)); @@ -477,8 +477,10 @@ HttpSM::attach_client_session(HttpClientSession *client_vc, IOBufferReader *buff // Collect log & stats information client_tcp_reused = (1 < ua_session->get_transact_count()) ? true : false; SSLNetVConnection *ssl_vc = dynamic_cast<SSLNetVConnection *>(ua_session->get_netvc()); - if (ssl_vc != NULL) + if (ssl_vc != NULL) { + client_connection_is_ssl = true; client_ssl_reused = ssl_vc->getSSLSessionCacheHit(); + } ink_release_assert(ua_session->get_half_close_flag() == false); mutex = client_vc->mutex; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0413469c/proxy/http/HttpSM.h ---------------------------------------------------------------------- diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h index e8f3f94..9508bbc 100644 --- a/proxy/http/HttpSM.h +++ b/proxy/http/HttpSM.h @@ -495,6 +495,7 @@ public: int64_t pushed_response_body_bytes; bool client_tcp_reused; bool client_ssl_reused; + bool client_connection_is_ssl; TransactionMilestones milestones; ink_hrtime api_timer; // The next two enable plugins to tag the state machine for http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0413469c/proxy/logging/Log.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc index 92878a1..1e758bd 100644 --- a/proxy/logging/Log.cc +++ b/proxy/logging/Log.cc @@ -449,6 +449,11 @@ Log::init_fields() global_field_list.add(field, false); ink_hash_table_insert(field_symbol_hash, "cqtr", field); + field = new LogField("client_req_ssl_reused", "cqssl", LogField::dINT, &LogAccess::marshal_client_req_is_ssl, + &LogAccess::unmarshal_int_to_str); + global_field_list.add(field, false); + ink_hash_table_insert(field_symbol_hash, "cqssl", field); + field = new LogField("client_req_ssl_reused", "cqssr", LogField::dINT, &LogAccess::marshal_client_req_ssl_reused, &LogAccess::unmarshal_int_to_str); global_field_list.add(field, false); http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0413469c/proxy/logging/LogAccess.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc index 4c3006f..a90a017 100644 --- a/proxy/logging/LogAccess.cc +++ b/proxy/logging/LogAccess.cc @@ -238,6 +238,15 @@ LogAccess::marshal_client_req_tcp_reused(char *buf) -------------------------------------------------------------------------*/ int +LogAccess::marshal_client_req_is_ssl(char *buf) +{ + DEFAULT_INT_FIELD; +} + +/*------------------------------------------------------------------------- + -------------------------------------------------------------------------*/ + +int LogAccess::marshal_client_req_ssl_reused(char *buf) { DEFAULT_INT_FIELD; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0413469c/proxy/logging/LogAccess.h ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h index ae8e97f..ca7d77a 100644 --- a/proxy/logging/LogAccess.h +++ b/proxy/logging/LogAccess.h @@ -186,6 +186,7 @@ public: inkcoreapi virtual int marshal_client_req_header_len(char *); // INT inkcoreapi virtual int marshal_client_req_body_len(char *); // INT inkcoreapi virtual int marshal_client_req_tcp_reused(char *); // INT + inkcoreapi virtual int marshal_client_req_is_ssl(char *); // INT inkcoreapi virtual int marshal_client_req_ssl_reused(char *); // INT inkcoreapi virtual int marshal_client_finish_status_code(char *); // INT http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0413469c/proxy/logging/LogAccessHttp.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc index 62d650a..fb1b5a9 100644 --- a/proxy/logging/LogAccessHttp.cc +++ b/proxy/logging/LogAccessHttp.cc @@ -581,6 +581,20 @@ LogAccessHttp::marshal_client_req_tcp_reused(char *buf) -------------------------------------------------------------------------*/ int +LogAccessHttp::marshal_client_req_is_ssl(char *buf) +{ + if (buf) { + int64_t is_ssl; + is_ssl = m_http_sm->client_connection_is_ssl; + marshal_int(buf, is_ssl); + } + return INK_MIN_ALIGN; +} + +/*------------------------------------------------------------------------- + -------------------------------------------------------------------------*/ + +int LogAccessHttp::marshal_client_req_ssl_reused(char *buf) { if (buf) { http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0413469c/proxy/logging/LogAccessHttp.h ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccessHttp.h b/proxy/logging/LogAccessHttp.h index 72d6f1a..e97eaa8 100644 --- a/proxy/logging/LogAccessHttp.h +++ b/proxy/logging/LogAccessHttp.h @@ -71,6 +71,7 @@ public: virtual int marshal_client_req_header_len(char *); // INT virtual int marshal_client_req_body_len(char *); // INT virtual int marshal_client_req_tcp_reused(char *); // INT + virtual int marshal_client_req_is_ssl(char *); // INT virtual int marshal_client_req_ssl_reused(char *); // INT virtual int marshal_client_finish_status_code(char *); // INT
