Repository: trafficserver Updated Branches: refs/heads/master c7328aaeb -> 31a3a0362
Clang-format Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/31a3a036 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/31a3a036 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/31a3a036 Branch: refs/heads/master Commit: 31a3a0362754adb9c0eeeaeaf6c242bd83a73375 Parents: c7328aa Author: Leif Hedstrom <[email protected]> Authored: Wed Jul 8 13:16:46 2015 -0600 Committer: Leif Hedstrom <[email protected]> Committed: Wed Jul 8 13:16:46 2015 -0600 ---------------------------------------------------------------------- iocore/cache/CacheTest.cc | 4 ++-- iocore/net/SSLNetVConnection.cc | 8 ++++---- iocore/net/SSLUtils.cc | 4 ++-- .../experimental/stream_editor/stream_editor.cc | 15 ++++++++++----- proxy/StatSystem.h | 5 ++--- proxy/http/HttpSM.cc | 16 ++++++++++------ proxy/http/HttpTransact.cc | 20 +++++++------------- proxy/http/HttpTransact.h | 4 ++-- proxy/logging/LogAccess.h | 3 +-- proxy/logging/LogAccessHttp.cc | 12 ++++-------- proxy/logging/LogField.cc | 2 +- 11 files changed, 45 insertions(+), 48 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/iocore/cache/CacheTest.cc ---------------------------------------------------------------------- diff --git a/iocore/cache/CacheTest.cc b/iocore/cache/CacheTest.cc index 1921060..fb55123 100644 --- a/iocore/cache/CacheTest.cc +++ b/iocore/cache/CacheTest.cc @@ -387,8 +387,8 @@ EXCLUSIVE_REGRESSION_TEST(cache)(RegressionTest *t, int /* atype ATS_UNUSED */, r_sequential(t, write_test.clone(), lookup_test.clone(), r_sequential(t, 10, read_test.clone()), remove_test.clone(), lookup_fail_test.clone(), read_fail_test.clone(), remove_fail_test.clone(), replace_write_test.clone(), - replace_test.clone(), replace_read_test.clone(), large_write_test.clone(), pread_test.clone(), - NULL_PTR)->run(pstatus); + replace_test.clone(), replace_read_test.clone(), large_write_test.clone(), pread_test.clone(), NULL_PTR) + ->run(pstatus); return; } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/iocore/net/SSLNetVConnection.cc ---------------------------------------------------------------------- diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc index b50f058..153aa19 100644 --- a/iocore/net/SSLNetVConnection.cc +++ b/iocore/net/SSLNetVConnection.cc @@ -790,10 +790,10 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, int64_t &wattempted, i SSLNetVConnection::SSLNetVConnection() : ssl(NULL), sslHandshakeBeginTime(0), sslLastWriteTime(0), sslTotalBytesSent(0), hookOpRequested(TS_SSL_HOOK_OP_DEFAULT), - sslHandShakeComplete(false), sslClientConnection(false), sslClientRenegotiationAbort(false), sslSessionCacheHit(false), handShakeBuffer(NULL), - handShakeHolder(NULL), handShakeReader(NULL), handShakeBioStored(0), sslPreAcceptHookState(SSL_HOOKS_INIT), - sslHandshakeHookState(HANDSHAKE_HOOKS_PRE), npnSet(NULL), npnEndpoint(NULL), sessionAcceptPtr(NULL), iobuf(NULL), reader(NULL), - eosRcvd(false) + sslHandShakeComplete(false), sslClientConnection(false), sslClientRenegotiationAbort(false), sslSessionCacheHit(false), + handShakeBuffer(NULL), handShakeHolder(NULL), handShakeReader(NULL), handShakeBioStored(0), + sslPreAcceptHookState(SSL_HOOKS_INIT), sslHandshakeHookState(HANDSHAKE_HOOKS_PRE), npnSet(NULL), npnEndpoint(NULL), + sessionAcceptPtr(NULL), iobuf(NULL), reader(NULL), eosRcvd(false) { } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/iocore/net/SSLUtils.cc ---------------------------------------------------------------------- diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc index 145684e..c4055e0 100644 --- a/iocore/net/SSLUtils.cc +++ b/iocore/net/SSLUtils.cc @@ -214,8 +214,8 @@ ssl_get_cached_session(SSL *ssl, unsigned char *id, int len, int *copy) // Double check the timeout if (ssl_session_timed_out(session)) { SSL_INCREMENT_DYN_STAT(ssl_session_cache_miss); - // Due to bug in openssl, the timeout is checked, but only removed - // from the openssl built-in hash table. The external remove cb is not called +// Due to bug in openssl, the timeout is checked, but only removed +// from the openssl built-in hash table. The external remove cb is not called #if 0 // This is currently eliminated, since it breaks things in odd ways (see TS-3710) ssl_rm_cached_session(SSL_get_SSL_CTX(ssl), session); session = NULL; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/plugins/experimental/stream_editor/stream_editor.cc ---------------------------------------------------------------------- diff --git a/plugins/experimental/stream_editor/stream_editor.cc b/plugins/experimental/stream_editor/stream_editor.cc index 072a225..56612d6 100644 --- a/plugins/experimental/stream_editor/stream_editor.cc +++ b/plugins/experimental/stream_editor/stream_editor.cc @@ -500,13 +500,18 @@ public: } rule_t(const rule_t &r) : scope(r.scope), priority(r.priority), from(r.from), to(r.to), refcount(r.refcount) { ++*refcount; } - ~rule_t() { + ~rule_t() + { if (!refcount || !--*refcount) { - if (scope) delete scope; - if (from) delete from; - if (to) TSfree(to); + if (scope) + delete scope; + if (from) + delete from; + if (to) + TSfree(to); } - if (refcount) delete refcount; + if (refcount) + delete refcount; } bool http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/proxy/StatSystem.h ---------------------------------------------------------------------- diff --git a/proxy/StatSystem.h b/proxy/StatSystem.h index 616aa43..8f1448b 100644 --- a/proxy/StatSystem.h +++ b/proxy/StatSystem.h @@ -50,12 +50,11 @@ class TransactionMilestones { public: - TransactionMilestones() { ink_zero(milestones); } - ink_hrtime& operator[] (TSMilestonesType ms) { return milestones[ms]; } + ink_hrtime &operator[](TSMilestonesType ms) { return milestones[ms]; } - ink_hrtime operator[] (TSMilestonesType ms) const { return milestones[ms]; } + ink_hrtime operator[](TSMilestonesType ms) const { return milestones[ms]; } /** * Takes two milestones and returns the difference. http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/proxy/http/HttpSM.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index af06f96..985d718 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -3947,7 +3947,9 @@ HttpSM::do_hostdb_lookup() historical_action = pending_action; } else { char *host_name = t_state.dns_info.srv_lookup_success ? t_state.dns_info.srv_hostname : t_state.dns_info.lookup_name; - opt.port = t_state.dns_info.srv_lookup_success ? t_state.dns_info.srv_port : t_state.server_info.dst_addr.isValid() ? t_state.server_info.dst_addr.host_order_port() : t_state.hdr_info.client_request.port_get(); + opt.port = t_state.dns_info.srv_lookup_success ? t_state.dns_info.srv_port : t_state.server_info.dst_addr.isValid() ? + t_state.server_info.dst_addr.host_order_port() : + t_state.hdr_info.client_request.port_get(); opt.flags = (t_state.cache_info.directives.does_client_permit_dns_storing) ? HostDBProcessor::HOSTDB_DO_NOT_FORCE_DNS : HostDBProcessor::HOSTDB_FORCE_DNS_RELOAD; opt.timeout = (t_state.api_txn_dns_timeout_value != -1) ? t_state.api_txn_dns_timeout_value : 0; @@ -3969,7 +3971,10 @@ HttpSM::do_hostdb_lookup() // If there is not a current server, we must be looking up the origin // server at the beginning of the transaction - int server_port = t_state.current.server ? t_state.current.server->dst_addr.host_order_port() : t_state.server_info.dst_addr.isValid() ? t_state.server_info.dst_addr.host_order_port() : t_state.hdr_info.client_request.port_get(); + int server_port = + t_state.current.server ? t_state.current.server->dst_addr.host_order_port() : t_state.server_info.dst_addr.isValid() ? + t_state.server_info.dst_addr.host_order_port() : + t_state.hdr_info.client_request.port_get(); if (t_state.api_txn_dns_timeout_value != -1) { DebugSM("http_timeout", "beginning DNS lookup. allowing %d mseconds for DNS lookup", t_state.api_txn_dns_timeout_value); @@ -6636,8 +6641,7 @@ HttpSM::update_stats() milestones[TS_MILESTONE_UA_CLOSE] = Thread::get_hrtime(); // request_process_time = The time after the header is parsed to the completion of the transaction - ink_hrtime request_process_time = - milestones[TS_MILESTONE_UA_CLOSE] - milestones[TS_MILESTONE_UA_READ_HEADER_DONE]; + ink_hrtime request_process_time = milestones[TS_MILESTONE_UA_CLOSE] - milestones[TS_MILESTONE_UA_READ_HEADER_DONE]; HttpTransact::client_result_stat(&t_state, total_time, request_process_time); @@ -6729,8 +6733,8 @@ HttpSM::update_stats() "sm_finish: %.3f " "plugin_active: %.3f " "plugin_total: %.3f", - sm_id, client_ip, t_state.client_info.src_addr.host_order_port(), url_string, status, unique_id_string, - redirection_tries, client_response_body_bytes, fd, t_state.client_info.state, t_state.server_info.state, + sm_id, client_ip, t_state.client_info.src_addr.host_order_port(), url_string, status, unique_id_string, redirection_tries, + client_response_body_bytes, fd, t_state.client_info.state, t_state.server_info.state, milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_UA_BEGIN), milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_UA_FIRST_READ), milestones.difference(TS_MILESTONE_SM_START, TS_MILESTONE_UA_READ_HEADER_DONE), http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/proxy/http/HttpTransact.cc ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index b685cf1..999790a 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -1434,7 +1434,7 @@ HttpTransact::setup_plugin_request_intercept(State *s) s->server_info.keep_alive = HTTP_NO_KEEPALIVE; s->host_db_info.app.http_data.http_version = HostDBApplicationInfo::HTTP_VERSION_10; s->host_db_info.app.http_data.pipeline_max = 1; - s->server_info.dst_addr.setToAnyAddr(AF_INET); // must set an address or we can't set the port. + s->server_info.dst_addr.setToAnyAddr(AF_INET); // must set an address or we can't set the port. s->server_info.dst_addr.port() = htons(s->hdr_info.client_request.port_get()); // this is the info that matters. // Build the request to the server @@ -8867,12 +8867,10 @@ HttpTransact::update_size_and_time_stats(State *s, ink_hrtime total_time, ink_hr // update milestones stats if (http_ua_begin_time_stat) { - HTTP_SUM_TRANS_STAT(http_ua_begin_time_stat, - milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_BEGIN)) + HTTP_SUM_TRANS_STAT(http_ua_begin_time_stat, milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_BEGIN)) } if (http_ua_first_read_time_stat) { - HTTP_SUM_TRANS_STAT(http_ua_first_read_time_stat, - milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_FIRST_READ)) + HTTP_SUM_TRANS_STAT(http_ua_first_read_time_stat, milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_FIRST_READ)) } if (http_ua_read_header_done_time_stat) { HTTP_SUM_TRANS_STAT(http_ua_read_header_done_time_stat, @@ -8883,8 +8881,7 @@ HttpTransact::update_size_and_time_stats(State *s, ink_hrtime total_time, ink_hr milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_BEGIN_WRITE)) } if (http_ua_close_time_stat) { - HTTP_SUM_TRANS_STAT(http_ua_close_time_stat, - milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_CLOSE)) + HTTP_SUM_TRANS_STAT(http_ua_close_time_stat, milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_UA_CLOSE)) } if (http_server_first_connect_time_stat) { HTTP_SUM_TRANS_STAT(http_server_first_connect_time_stat, @@ -8911,8 +8908,7 @@ HttpTransact::update_size_and_time_stats(State *s, ink_hrtime total_time, ink_hr milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_READ_HEADER_DONE)) } if (http_server_close_time_stat) { - HTTP_SUM_TRANS_STAT(http_server_close_time_stat, - milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_CLOSE)) + HTTP_SUM_TRANS_STAT(http_server_close_time_stat, milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SERVER_CLOSE)) } if (http_cache_open_read_begin_time_stat) { HTTP_SUM_TRANS_STAT(http_cache_open_read_begin_time_stat, @@ -8939,12 +8935,10 @@ HttpTransact::update_size_and_time_stats(State *s, ink_hrtime total_time, ink_hr milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_DNS_LOOKUP_END)) } if (http_sm_start_time_stat) { - HTTP_SUM_TRANS_STAT(http_sm_start_time_stat, - milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SM_START)) + HTTP_SUM_TRANS_STAT(http_sm_start_time_stat, milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SM_START)) } if (http_sm_finish_time_stat) { - HTTP_SUM_TRANS_STAT(http_sm_finish_time_stat, - milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SM_FINISH)) + HTTP_SUM_TRANS_STAT(http_sm_finish_time_stat, milestones.difference_msec(TS_MILESTONE_SM_START, TS_MILESTONE_SM_FINISH)) } } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/proxy/http/HttpTransact.h ---------------------------------------------------------------------- diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h index e33bc7f..02eab8d 100644 --- a/proxy/http/HttpTransact.h +++ b/proxy/http/HttpTransact.h @@ -655,11 +655,11 @@ public: TransferEncoding_t transfer_encoding; /** This is the source address of the connection from the point of view of the transaction. - It is the address of the source of the request. + It is the address of the source of the request. */ IpEndpoint src_addr; /** This is the destination address of the connection from the point of view of the transaction. - It is the address of the target of the request. + It is the address of the target of the request. */ IpEndpoint dst_addr; http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/proxy/logging/LogAccess.h ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h index 98f8271..ec9feb4 100644 --- a/proxy/logging/LogAccess.h +++ b/proxy/logging/LogAccess.h @@ -288,8 +288,7 @@ public: // milestones access // inkcoreapi virtual int marshal_milestone(TSMilestonesType ms, char *buf); - inkcoreapi virtual int marshal_milestone_diff(TSMilestonesType ms1, TSMilestonesType ms2, - char *buf); + inkcoreapi virtual int marshal_milestone_diff(TSMilestonesType ms1, TSMilestonesType ms2, char *buf); // // unmarshalling routines http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/proxy/logging/LogAccessHttp.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc index 08e7b66..28d6c61 100644 --- a/proxy/logging/LogAccessHttp.cc +++ b/proxy/logging/LogAccessHttp.cc @@ -999,8 +999,7 @@ int LogAccessHttp::marshal_server_resp_time_ms(char *buf) { if (buf) { - ink_hrtime elapsed = - m_http_sm->milestones[TS_MILESTONE_SERVER_CLOSE] - m_http_sm->milestones[TS_MILESTONE_SERVER_CONNECT]; + ink_hrtime elapsed = m_http_sm->milestones[TS_MILESTONE_SERVER_CLOSE] - m_http_sm->milestones[TS_MILESTONE_SERVER_CONNECT]; int64_t val = (int64_t)ink_hrtime_to_msec(elapsed); marshal_int(buf, val); } @@ -1011,8 +1010,7 @@ int LogAccessHttp::marshal_server_resp_time_s(char *buf) { if (buf) { - ink_hrtime elapsed = - m_http_sm->milestones[TS_MILESTONE_SERVER_CLOSE] - m_http_sm->milestones[TS_MILESTONE_SERVER_CONNECT]; + ink_hrtime elapsed = m_http_sm->milestones[TS_MILESTONE_SERVER_CLOSE] - m_http_sm->milestones[TS_MILESTONE_SERVER_CONNECT]; int64_t val = (int64_t)ink_hrtime_to_sec(elapsed); marshal_int(buf, val); } @@ -1160,8 +1158,7 @@ int LogAccessHttp::marshal_transfer_time_ms(char *buf) { if (buf) { - ink_hrtime elapsed = - m_http_sm->milestones[TS_MILESTONE_SM_FINISH] - m_http_sm->milestones[TS_MILESTONE_SM_START]; + ink_hrtime elapsed = m_http_sm->milestones[TS_MILESTONE_SM_FINISH] - m_http_sm->milestones[TS_MILESTONE_SM_START]; int64_t val = (int64_t)ink_hrtime_to_msec(elapsed); marshal_int(buf, val); } @@ -1172,8 +1169,7 @@ int LogAccessHttp::marshal_transfer_time_s(char *buf) { if (buf) { - ink_hrtime elapsed = - m_http_sm->milestones[TS_MILESTONE_SM_FINISH] - m_http_sm->milestones[TS_MILESTONE_SM_START]; + ink_hrtime elapsed = m_http_sm->milestones[TS_MILESTONE_SM_FINISH] - m_http_sm->milestones[TS_MILESTONE_SM_START]; int64_t val = (int64_t)ink_hrtime_to_sec(elapsed); marshal_int(buf, val); } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/31a3a036/proxy/logging/LogField.cc ---------------------------------------------------------------------- diff --git a/proxy/logging/LogField.cc b/proxy/logging/LogField.cc index 068172f..6ddfe79 100644 --- a/proxy/logging/LogField.cc +++ b/proxy/logging/LogField.cc @@ -120,7 +120,7 @@ LogSlice::toStrOffset(int strlen, int *offset) -------------------------------------------------------------------------*/ struct cmp_str { - bool operator() (ts::ConstBuffer a, ts::ConstBuffer b) const { return memcmp(a._ptr, b._ptr, MAX(a._size, b._size)) < 0; } + bool operator()(ts::ConstBuffer a, ts::ConstBuffer b) const { return memcmp(a._ptr, b._ptr, MAX(a._size, b._size)) < 0; } }; typedef std::map<ts::ConstBuffer, TSMilestonesType, cmp_str> milestone_map;
