You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2018/01/30 15:51:31 UTC
[trafficserver] branch master updated: Changes to allow for
possible stale ua_session pointer in HttpSM object.
This is an automated email from the ASF dual-hosted git repository.
amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 2aee3b6 Changes to allow for possible stale ua_session pointer in HttpSM object.
2aee3b6 is described below
commit 2aee3b6caee60ce98d3f664382a0b64b0c878337
Author: Walt Karas <wk...@yahoo-inc.com>
AuthorDate: Tue Dec 5 18:08:09 2017 +0000
Changes to allow for possible stale ua_session pointer in HttpSM object.
(cherry picked from OATH-internal commit 6d79b71950e14b13167fdf6422bf0e68bad6fccc)
---
proxy/http/HttpSM.cc | 11 +++++++++++
proxy/http/HttpSM.h | 13 +++++++++++++
proxy/logging/LogAccessHttp.cc | 13 ++-----------
3 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 159cc36..95f9d07 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -437,6 +437,17 @@ HttpSM::attach_client_session(ProxyClientTransaction *client_vc, IOBufferReader
}
ua_txn = client_vc;
+ // It seems to be possible that the ua_txn pointer will go stale before log entries for this HTTP transaction are
+ // generated. Therefore, collect information that may be needed for logging from the ua_txn object at this point.
+ //
+ _client_transaction_id = ua_txn->get_transaction_id();
+ {
+ auto p = ua_txn->get_parent();
+ if (p) {
+ _client_connection_id = p->connection_id();
+ }
+ }
+
// Collect log & stats information
client_tcp_reused = !(ua_txn->is_first_transaction());
SSLNetVConnection *ssl_vc = dynamic_cast<SSLNetVConnection *>(netvc);
diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index 21fe894..1b44e9b 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -583,8 +583,21 @@ public:
return terminate_sm;
}
+ int
+ client_connection_id() const
+ {
+ return _client_connection_id;
+ }
+
+ int
+ client_transaction_id() const
+ {
+ return _client_transaction_id;
+ }
+
private:
PostDataBuffers _postbuf;
+ int _client_connection_id = -1, _client_transaction_id = -1;
};
// Function to get the cache_sm object - YTS Team, yamsat
diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc
index 0cdce93..059d8af 100644
--- a/proxy/logging/LogAccessHttp.cc
+++ b/proxy/logging/LogAccessHttp.cc
@@ -1473,13 +1473,7 @@ LogAccessHttp::marshal_client_http_connection_id(char *buf)
if (buf) {
int64_t id = 0;
if (m_http_sm) {
- auto p = m_http_sm->ua_txn;
- if (p) {
- auto p2 = p->get_parent();
- if (p2) {
- id = p2->connection_id();
- }
- }
+ id = m_http_sm->client_connection_id();
}
marshal_int(buf, id);
}
@@ -1495,10 +1489,7 @@ LogAccessHttp::marshal_client_http_transaction_id(char *buf)
if (buf) {
int64_t id = 0;
if (m_http_sm) {
- auto p = m_http_sm->ua_txn;
- if (p) {
- id = p->get_transaction_id();
- }
+ id = m_http_sm->client_transaction_id();
}
marshal_int(buf, id);
}
--
To stop receiving notification emails like this one, please contact
amc@apache.org.