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: TS C++ API: add member function TSSslConnection InterceptPlugin::getSslConnection()
Date Thu, 02 May 2019 13:16:48 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 92ecbcb  TS C++ API:  add member function TSSslConnection InterceptPlugin::getSslConnection()
92ecbcb is described below

commit 92ecbcbe194621a0f2f2d1fddc5e143f8390e9c2
Author: Walter Karas <wkaras@verizonmedia.com>
AuthorDate: Wed May 1 15:30:28 2019 -0500

    TS C++ API:  add member function TSSslConnection InterceptPlugin::getSslConnection()
---
 include/tscpp/api/InterceptPlugin.h |  6 ++++++
 src/tscpp/api/InterceptPlugin.cc    | 11 +++++++++++
 2 files changed, 17 insertions(+)

diff --git a/include/tscpp/api/InterceptPlugin.h b/include/tscpp/api/InterceptPlugin.h
index 62eb234..d7d6597 100644
--- a/include/tscpp/api/InterceptPlugin.h
+++ b/include/tscpp/api/InterceptPlugin.h
@@ -68,6 +68,12 @@ public:
   /** Should be called only after request header has completely been consumed */
   Headers &getRequestHeaders();
 
+  /**
+   * The returned TSSslConnection would be nullptr if the connection is not a TLS connection
+   * or Intercept plugin is not ready.
+   */
+  TSSslConnection getSslConnection();
+
   ~InterceptPlugin() override;
 
   struct State; /** Internal use only */
diff --git a/src/tscpp/api/InterceptPlugin.cc b/src/tscpp/api/InterceptPlugin.cc
index db0bd00..b3ad83b 100644
--- a/src/tscpp/api/InterceptPlugin.cc
+++ b/src/tscpp/api/InterceptPlugin.cc
@@ -181,6 +181,17 @@ InterceptPlugin::getRequestHeaders()
   return state_->request_headers_;
 }
 
+TSSslConnection
+InterceptPlugin::getSslConnection()
+{
+  if (!state_->net_vc_) {
+    LOG_ERROR("Intercept Plugin is not ready to provide SSL Connection");
+    return nullptr;
+  }
+
+  return TSVConnSSLConnectionGet(state_->net_vc_);
+}
+
 bool
 InterceptPlugin::doRead()
 {


Mime
View raw message