Skip to content

Conversation

@shinrich
Copy link
Member

Adding a convenience API for working with SSL connections.

This closes #10323

Description
-----------
Returns the file descriptor associated with the SSL connection :arg:`sslp`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to limit this just for SSL connection? Are we going to add TSVConnFdGet and TSVConnQuicFdGet if we needed? Plugins would need to call isSSL() and isQUIC() then call the corresponding TSVConnXFdGet()`. It doesn't sounds handy.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that crossed my mind as I pushed the branch up. Let me take a pass at generalizing.

include/ts/ts.h Outdated
TSReturnCode TSVConnTunnel(TSVConn sslp);
/* Return the SSL object associated with the connection */
TSSslConnection TSVConnSslConnectionGet(TSVConn sslp);
/* Return the file descriptoer associated with the ssl connection */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove "ssl".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the comment :)

@maskit
Copy link
Member

maskit commented Sep 6, 2023

The change looks almost fine, but I don't see API proposal for this on the list.


int
tsapi::c::TSVConnFdGet(TSVConn vconnp)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It kinda feels that we should do the normal assertion on the vconnp here, rather than checking the nullptr after the casting. Like the common pattern is

sdk_assert(sdk_sanity_check_null_ptr((void *)vconnp) == TS_SUCCESS);

I guess I'm fine checking the vconnp explicitly as well, but probably should be done before the cast.

@zwoop zwoop added this to the 10.0.0 milestone Sep 7, 2023
@shinrich
Copy link
Member Author

shinrich commented Sep 8, 2023

Sent the API email to the list a couple days ago. Will make a new PR with the remaining changes next week.

@bryancall bryancall changed the title Add TSVConnSslFdGet api Add TSVConnFdGet api Sep 11, 2023
@bryancall bryancall requested a review from zwoop September 11, 2023 22:20
@shinrich shinrich merged commit 7ddb721 into apache:master Sep 11, 2023
bryancall pushed a commit that referenced this pull request Sep 29, 2023
(cherry picked from commit 7ddb721)

 Conflicts:
	include/ts/ts.h
@bryancall bryancall modified the milestones: 10.0.0, 9.2.3 Oct 5, 2023
bryancall pushed a commit that referenced this pull request Oct 6, 2023
(cherry picked from commit 7ddb721)

 Conflicts:
	include/ts/ts.h
	src/traffic_server/InkAPI.cc
bryancall pushed a commit that referenced this pull request Oct 6, 2023
(cherry picked from commit 7ddb721)

 Conflicts:
	include/ts/ts.h
	src/traffic_server/InkAPI.cc
traeak pushed a commit to traeak/trafficserver that referenced this pull request Dec 15, 2023
(cherry picked from commit 7ddb721)

 Conflicts:
	include/ts/ts.h
cmcfarlen pushed a commit to cmcfarlen/trafficserver that referenced this pull request Jun 3, 2024
cmcfarlen pushed a commit to cmcfarlen/trafficserver that referenced this pull request Jun 3, 2024
* commit '236b749b2b3cc746829ad534a7034ab7799d1b71':
  Allow origins to do TLS renegotiation (apache#10385)
  Remove deprecated debug output functions from 21 source files. (apache#9683)
  Fixes some make test build problems (apache#10402)
  Removes unused Errata functions from WCCP (apache#10380)
  Move InkAPI.cc into src/api (apache#10315)
  cmake: Generate files in rc, install the trafficserver script (apache#10367)
  Add support for OCSP requests by GET method (apache#10306)
  Preserve unmapped url regardless of need for remapping (apache#10304)
  Add TSVConnFdGet api (apache#10324)
  include/ts: comma on all last enum elements (apache#10400)
  cmake: Add remaining plugins without external deps (apache#10395)
  CID-1508974 (apache#10397)
  CID-1508987 (apache#10398)
  Coverity 1518564: fix off by one (apache#10401)
masaori335 pushed a commit to masaori335/trafficserver that referenced this pull request Dec 10, 2024
(cherry picked from commit 7ddb721)

Conflicts:
	include/ts/ts.h
	src/traffic_server/InkAPI.cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create helper TS API to return the file descriptor associated with a SSL connection

5 participants