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 5bf11e4  Added api for ssnid
5bf11e4 is described below

commit 5bf11e4c29ded0675419d63878b450947cb29f4b
Author: Zeyuan Yu <zeyu...@gmail.com>
AuthorDate: Fri May 11 16:01:55 2018 +0000

    Added api for ssnid
---
 .../api/functions/TSHttpSsnIdGet.en.rst            | 44 ++++++++++++++++++++++
 proxy/InkAPI.cc                                    |  9 +++++
 proxy/api/ts/ts.h                                  |  3 ++
 3 files changed, 56 insertions(+)

diff --git a/doc/developer-guide/api/functions/TSHttpSsnIdGet.en.rst 
b/doc/developer-guide/api/functions/TSHttpSsnIdGet.en.rst
new file mode 100644
index 0000000..a9b30ae
--- /dev/null
+++ b/doc/developer-guide/api/functions/TSHttpSsnIdGet.en.rst
@@ -0,0 +1,44 @@
+.. 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.
+
+.. default-domain:: c
+
+TSHttpSsnIdGet
+*******************
+
+Returns the unique identifier for client session.
+
+Synopsis
+========
+
+`#include <ts/ts.h>`
+
+.. function:: int64_t TSHttpSsnIdGet(TSHttpSsn ssnp)
+
+Description
+===========
+
+:func:`TSHttpSsnIdGet` returns the unique identifier for this client session.
+
+Return Values
+=============
+
+Returns a :type:`int64_t` as the unique ID
+
+See also
+========
+
+:manpage:`TSAPI(3ts)`
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 422ccdf..8e6e09b 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -9577,6 +9577,15 @@ TSHttpTxnIdGet(TSHttpTxn txnp)
   return (uint64_t)sm->sm_id;
 }
 
+// Returns unique client session identifier
+int64_t
+TSHttpSsnIdGet(TSHttpSsn ssnp)
+{
+  sdk_assert(sdk_sanity_check_http_ssn(ssnp) == TS_SUCCESS);
+  ProxyClientSession *cs = reinterpret_cast<ProxyClientSession *>(ssnp);
+  return cs->connection_id();
+}
+
 // Return information about the protocols used by the client
 TSReturnCode
 TSHttpTxnClientProtocolStackGet(TSHttpTxn txnp, int n, const char **result, 
int *actual)
diff --git a/proxy/api/ts/ts.h b/proxy/api/ts/ts.h
index 7598fc2..9ef463e 100644
--- a/proxy/api/ts/ts.h
+++ b/proxy/api/ts/ts.h
@@ -2362,6 +2362,9 @@ tsapi int TSHttpTxnIsWebsocket(TSHttpTxn txnp);
 /* Get the Txn's (HttpSM's) unique identifier, which is a sequence number 
since server start) */
 tsapi uint64_t TSHttpTxnIdGet(TSHttpTxn txnp);
 
+/* Get the Ssn's unique identifier */
+tsapi int64_t TSHttpSsnIdGet(TSHttpSsn ssnp);
+
 /* Expose internal Base64 Encoding / Decoding */
 tsapi TSReturnCode TSBase64Decode(const char *str, size_t str_len, unsigned 
char *dst, size_t dst_size, size_t *length);
 tsapi TSReturnCode TSBase64Encode(const char *str, size_t str_len, char *dst, 
size_t dst_size, size_t *length);

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

Reply via email to