Skip to content

Conversation

traeak
Copy link
Contributor

@traeak traeak commented Sep 15, 2025

This adds to the ts api to allows the selected parent strategy to be changed during a transaction using a 'c' friendly API.

APIs added:

Set and get via strategy pointer.

  • void TSHttpTxnNextHopStrategySet(TSHttpTxn txnp, void const *strategy);
  • void const* TSHttpTxnNextHopStrategyGet(TSHttpTxn txnp);

Gets the name of the provided strategy

  • char const* TSHttpNextHopStrategyNameGet(void const *strategy);

The below looks up a strategy by name by using the current transaction to get to the NextHopStrategyFactory.

  • void const* TSHttpTxnNextHopNamedStrategyGet(TSHttpTxn txnp, char const *name);

Support added to:

  • header_rewrite
  • regex_remap
  • lua

Ideally there also should be a way to make the NextHopStrategyFactory pointer directly available to TSRemapNewInstance.

@traeak traeak changed the title API for Strategy rebind during transaction API for Next Hop Strategy rebind during a transaction Sep 15, 2025
@traeak traeak force-pushed the strategy_rebind branch 2 times, most recently from 4009100 to 1d2557d Compare September 22, 2025 22:24
@traeak traeak marked this pull request as ready for review September 23, 2025 15:54
This adds 'c' friendly api calls to get and set strategies,
to get the name of a given strategy and
to get a strategy from the strategy factory by name.

Also includes additions to header_rewrite, regex_remap and lua plugins.
@zwoop
Copy link
Contributor

zwoop commented Sep 25, 2025

Did you email the mailing list with the new API additions ?

@traeak
Copy link
Contributor Author

traeak commented Oct 6, 2025

I think more tests need to be added for corner cases. Also on request am working on setting up a stress test case to ensure that converting the strategy shared_ptr to plain pointers doesn't result in faults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants