This is an automated email from the ASF dual-hosted git repository.

maskit 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 a3c5cb51b7 TS API: TSVConnSslSniGet sets 0 as length if it returns 
nullptr (#11773)
a3c5cb51b7 is described below

commit a3c5cb51b77034d93a3ab090aa8f319d498b08ac
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Wed Sep 18 10:09:31 2024 -0600

    TS API: TSVConnSslSniGet sets 0 as length if it returns nullptr (#11773)
---
 doc/developer-guide/api/functions/TSVConnSslSniGet.en.rst | 2 ++
 src/api/InkAPI.cc                                         | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/doc/developer-guide/api/functions/TSVConnSslSniGet.en.rst 
b/doc/developer-guide/api/functions/TSVConnSslSniGet.en.rst
index dd8a091ca0..4973dd2521 100644
--- a/doc/developer-guide/api/functions/TSVConnSslSniGet.en.rst
+++ b/doc/developer-guide/api/functions/TSVConnSslSniGet.en.rst
@@ -32,3 +32,5 @@ Synopsis
 Description
 -----------
 Get the SNI (Server Name Indication) that corresponds to SSL connection 
:arg:`sslp`.
+
+If :arg:`length` is not null, the length of the returned string (or 0 if this 
function returns null) will be stored.
diff --git a/src/api/InkAPI.cc b/src/api/InkAPI.cc
index 6de5a09bab..83aba64917 100644
--- a/src/api/InkAPI.cc
+++ b/src/api/InkAPI.cc
@@ -7929,6 +7929,9 @@ const char *
 TSVConnSslSniGet(TSVConn sslp, int *length)
 {
   if (sslp == nullptr) {
+    if (length) {
+      *length = 0;
+    }
     return nullptr;
   }
 

Reply via email to