You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by pa...@apache.org on 2017/11/06 23:02:17 UTC
[trafficserver] branch master updated: API for retrieving TSVConn
from TSHttpSsn
This is an automated email from the ASF dual-hosted git repository.
paziz 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 31725e6 API for retrieving TSVConn from TSHttpSsn
31725e6 is described below
commit 31725e635b932446ffa256a984b61306cfc7567e
Author: Persia Aziz <pe...@yahoo-inc.com>
AuthorDate: Tue Oct 31 10:06:35 2017 -0500
API for retrieving TSVConn from TSHttpSsn
---
doc/developer-guide/api/functions/TSVConn.en.rst | 40 ++++++++++++++++++++++++
proxy/InkAPI.cc | 14 +++++++++
proxy/api/ts/ts.h | 3 ++
3 files changed, 57 insertions(+)
diff --git a/doc/developer-guide/api/functions/TSVConn.en.rst b/doc/developer-guide/api/functions/TSVConn.en.rst
new file mode 100644
index 0000000..e3f625b
--- /dev/null
+++ b/doc/developer-guide/api/functions/TSVConn.en.rst
@@ -0,0 +1,40 @@
+.. Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed
+ with this work for additional information regarding copyright
+ ownership. The ASF licenses this file to you under the Apache
+ License, Version 2.0 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
+.. include:: ../../../common.defs
+
+.. default-domain:: c
+
+TSVConn
+*******
+
+Traffic Server APIs to get :type:`TSVConn` from :type:`TSHttpSsn` object
+
+Synopsis
+========
+
+`#include <ts/ts.h>`
+
+.. function:: TSVConn TSHttpSsnClientVConnGet(TSHttpSsn ssnp)
+.. function:: TSVConn TSHttpSsnServerVConnGet(TSHttpSsn ssnp)
+
+Description
+===========
+
+These APIs allow the developer to get the NetVconnection (represented by :type:`TSVConn`) from the Http session (:type:`TSHttpSsn`) object.
+
+:func:`TSHttpSsnClientVConnGet` returns the :type:`TSVConn` associated with the client side :type:`TSHttpSsn` object.
+:func:`TSHttpSsnServerVConnGet` returns the same associated with the server side :type:`TSHttpSsn`.
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 7c417a2..ead3577 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -4559,6 +4559,20 @@ TSHttpSsnTransactionCount(TSHttpSsn ssnp)
return cs->get_transact_count();
}
+TSVConn
+TSHttpSsnClientVConnGet(TSHttpSsn ssnp)
+{
+ ProxyClientSession *cs = reinterpret_cast<ProxyClientSession *>(ssnp);
+ return reinterpret_cast<TSVConn>(cs->get_netvc());
+}
+
+TSVConn
+TSHttpSsnServerVConnGet(TSHttpSsn ssnp)
+{
+ HttpServerSession *ss = reinterpret_cast<HttpServerSession *>(ssnp);
+ return reinterpret_cast<TSVConn>(ss->get_netvc());
+}
+
class TSHttpSsnCallback : public Continuation
{
public:
diff --git a/proxy/api/ts/ts.h b/proxy/api/ts/ts.h
index 8027b06..5a0818d 100644
--- a/proxy/api/ts/ts.h
+++ b/proxy/api/ts/ts.h
@@ -1220,6 +1220,9 @@ tsapi void TSHttpHookAdd(TSHttpHookID id, TSCont contp);
tsapi void TSHttpSsnHookAdd(TSHttpSsn ssnp, TSHttpHookID id, TSCont contp);
tsapi void TSHttpSsnReenable(TSHttpSsn ssnp, TSEvent event);
tsapi int TSHttpSsnTransactionCount(TSHttpSsn ssnp);
+// get TSVConn from session
+tsapi TSVConn TSHttpSsnClientVConnGet(TSHttpSsn ssnp);
+tsapi TSVConn TSHttpSsnServerVConnGet(TSHttpSsn ssnp);
/* --------------------------------------------------------------------------
SSL connections */
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].