trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [trafficserver] branch master updated: Remove leap-into-the-abyss casting from TSTransformCreate().
Date Thu, 15 Mar 2018 19:37:36 GMT
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 7f295bf  Remove leap-into-the-abyss casting from TSTransformCreate().
7f295bf is described below

commit 7f295bf409282528ce4c81735c290631e7d7d9da
Author: Walt Karas <wkaras@yahoo-inc.com>
AuthorDate: Mon Mar 12 22:16:51 2018 +0000

    Remove leap-into-the-abyss casting from TSTransformCreate().
---
 iocore/eventsystem/I_Continuation.h | 8 ++++++++
 proxy/InkAPI.cc                     | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/iocore/eventsystem/I_Continuation.h b/iocore/eventsystem/I_Continuation.h
index dbd4e84..a7ecbd3 100644
--- a/iocore/eventsystem/I_Continuation.h
+++ b/iocore/eventsystem/I_Continuation.h
@@ -116,9 +116,17 @@ public:
     lock is initialized in the constructor and should not be set
     directly.
 
+    TODO:  make this private.
+
   */
   Ptr<ProxyMutex> mutex;
 
+  ProxyMutex *
+  getMutex() const
+  {
+    return mutex.get();
+  }
+
   /**
     Link to other continuations.
 
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 5dd1319..77c7b03 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -6722,9 +6722,9 @@ TSVConn
 TSTransformCreate(TSEventFunc event_funcp, TSHttpTxn txnp)
 {
   sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
-  // TODO: This is somewhat of a leap of faith, but I think a TSHttpTxn is just another
-  // fancy continuation?
-  return TSVConnCreate(event_funcp, TSContMutexGet(reinterpret_cast<TSCont>(txnp)));
+
+  return TSVConnCreate(event_funcp,
+                       reinterpret_cast<TSMutex>(static_cast<Continuation *>(reinterpret_cast<HttpSM
*>(txnp))->getMutex()));
 }
 
 TSVConn

-- 
To stop receiving notification emails like this one, please contact
amc@apache.org.

Mime
View raw message