Skip to content

Commit fc5b056

Browse files
committed
fix for NextHopStrategyNameGet
1 parent 00c8021 commit fc5b056

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

include/ts/ts.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ char *TSHttpTxnErrorBodyGet(TSHttpTxn txnp, size_t *buflength, char **mimetype);
15841584
Returns nullptr if no strategy is found.
15851585
This uses the current transaction's state machine to get
15861586
access to UrlRewrite's NextHopStrategyFactory.
1587-
It's preferable to retrive strategies during TSRemapNewInstance.
1587+
It's preferable to retrieve strategies during TSRemapNewInstance.
15881588
15891589
@param txnp HTTP transaction which holds the strategy table.
15901590
@param name of the strategy to look up.
@@ -1594,7 +1594,7 @@ void const *TSHttpTxnNextHopStrategyFind(TSHttpTxn txnp, const char *name);
15941594

15951595
/**
15961596
Sets the Transaction's Next Hop Parent Strategy.
1597-
Must be called before parent selection logic is required.
1597+
Must be called before parent selection logic is required.
15981598
15991599
You can get this strategy pointer by calling TSHttpTxnParentStrategyGet().
16001600
@@ -1617,7 +1617,7 @@ void const *TSHttpTxnNextHopStrategyGet(TSHttpTxn txnp);
16171617

16181618
/**
16191619
Returns either null pointer or null terminated pointer to name.
1620-
DO NOT FREE.
1620+
DO NOT FREE.
16211621
16221622
This value may be a nullptr due to:
16231623
- parent proxying not enabled
@@ -1630,8 +1630,8 @@ char const *TSNextHopStrategyNameGet(void const *strategy);
16301630

16311631
/**
16321632
Retrieves a pointer to the named strategy in the strategy table.
1633-
This can only be called during TSRemapNewInstance.
1634-
DO NOT FREE.
1633+
This can only be called during TSRemapNewInstance.
1634+
DO NOT FREE.
16351635
16361636
Returns nullptr if no strategy found.
16371637
This uses the currently being loaded RemapConfig NextHopStrategyFactory.
@@ -1643,19 +1643,18 @@ void const *TSRemapNextHopStrategyFind(const char *name);
16431643

16441644
/**
16451645
Retrieves a pointer to remap rule strategy pointer.
1646-
This can only be called during TSRemapNewInstance.
1647-
DO NOT FREE.
1646+
This can only be called during TSRemapNewInstance.
1647+
DO NOT FREE.
16481648
16491649
Returns nullptr if no strategy assigned.
1650-
@param name of the strategy to look up.
16511650
16521651
*/
16531652
void const *TSRemapNextHopStrategyGet();
16541653

16551654
/**
16561655
Retrieves a pointer to the named strategy in the strategy table.
1657-
This can only be called during TSRemapNewInstance.
1658-
DO NOT FREE.
1656+
This can only be called during TSRemapNewInstance.
1657+
DO NOT FREE.
16591658
16601659
Returns nullptr if no strategy found.
16611660
This uses the currently being loaded RemapConfig NextHopStrategyFactory.

plugins/header_rewrite/conditions.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,12 +1539,13 @@ ConditionNextHop::append_value(std::string &s, const Resources &res)
15391539
s.append(std::to_string(port));
15401540
} break;
15411541
case NEXT_HOP_STRATEGY: {
1542-
char const *const name = TSNextHopStrategyNameGet(res.state.txnp);
1543-
if (nullptr != name) {
1542+
void const *const strategy = TSHttpTxnNextHopStrategyGet(res.state.txnp);
1543+
if (nullptr != strategy) {
1544+
char const *const name = TSNextHopStrategyNameGet(strategy);
15441545
Dbg(pi_dbg_ctl, "Appending '%s' to evaluation value", name);
15451546
s.append(name);
15461547
} else {
1547-
Dbg(pi_dbg_ctl, "NextHopStrategyName is empty");
1548+
Dbg(pi_dbg_ctl, "NextHopStrategy is empty");
15481549
}
15491550
} break;
15501551
default:

0 commit comments

Comments
 (0)