maskit commented on code in PR #12914:
URL: https://github.com/apache/trafficserver/pull/12914#discussion_r2875571558
##########
src/api/InkAPI.cc:
##########
@@ -7920,6 +7922,37 @@ TSVConnSslSniGet(TSVConn sslp, int *length)
return server_name;
}
+TSClientHello
+TSVConnClientHelloGet(TSVConn sslp)
+{
+ NetVConnection *netvc = reinterpret_cast<NetVConnection *>(sslp);
+ if (netvc == nullptr) {
+ return nullptr;
+ }
+
+ if (auto snis = netvc->get_service<TLSSNISupport>(); snis) {
+ TLSSNISupport::ClientHello *client_hello = snis->get_client_hello();
+ if (client_hello == nullptr) {
+ return nullptr;
+ }
+
+ // Wrap the raw object in the accessor and return
+ return TSClientHello(client_hello);
+ }
+
+ return nullptr;
+}
+
+TSReturnCode
+TSClientHelloExtensionGet(TSClientHello ch, unsigned int type, const unsigned
char **out, size_t *outlen)
+{
+ if (static_cast<TLSSNISupport::ClientHello
*>(ch._get_internal())->getExtension(type, out, outlen) == 1) {
+ return TS_SUCCESS;
+ }
+
Review Comment:
It's documented. Nullptr should not be passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]