Skip to content

Commit 6da2339

Browse files
committed
update comments and documentaiton
1 parent 1d659de commit 6da2339

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

include/proxy/http/remap/RemapConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct BUILD_TABLE_INFO {
7777
BUILD_TABLE_INFO(const BUILD_TABLE_INFO &) = delete; // disabled
7878
BUILD_TABLE_INFO &operator=(const BUILD_TABLE_INFO &) = delete; // disabled
7979

80-
// This is used to expose rewrite and its next hop strategy factory.
80+
// Exposes the main build table to the API for use during TSRemapNewInstance.
8181
inline static BUILD_TABLE_INFO *instance = nullptr;
8282
};
8383

include/ts/ts.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,10 +1619,10 @@ char const *TSHttpNextHopStrategyNameGet(void const *strategy);
16191619
/**
16201620
Retrieves a pointer to the named strategy in the strategy table.
16211621
This can only be called during TSRemapNewInstance.
1622-
Returns nullptr if no strategy found.
1623-
This uses the current RemapInit NextHopStrategyFactory.
1622+
DO NOT FREE.
16241623
1625-
This strategy pointer can still be used by all following transactions.
1624+
Returns nullptr if no strategy found.
1625+
This uses the currently being loaded RemapConfig NextHopStrategyFactory.
16261626
16271627
@param name of the strategy to look up.
16281628

src/api/InkAPI.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5051,13 +5051,14 @@ TSHttpInitNextHopNamedStrategyGet(const char *name)
50515051

50525052
sdk_assert(sdk_sanity_check_null_ptr((void *)bt) == TS_SUCCESS);
50535053
sdk_assert(sdk_sanity_check_null_ptr((void *)bt->rewrite) == TS_SUCCESS);
5054-
sdk_assert(sdk_sanity_check_null_ptr((void *)bt->rewrite->strategyFactory) == TS_SUCCESS);
50555054

5056-
// HttpSM has a reference count handle to UrlRewrite which has a
5057-
// pointer to NextHopStrategyFactory
5058-
NextHopSelectionStrategy const *const strat = bt->rewrite->strategyFactory->strategyInstance(name);
5055+
NextHopSelectionStrategy const *strat = nullptr;
50595056

5060-
fprintf(stderr, "strategy: %s, ptr: %p\n", name, (void *)strat);
5057+
if (nullptr != bt->rewrite->strategyFactory) {
5058+
// HttpSM has a reference count handle to UrlRewrite which manages
5059+
// the NextHopStrategyFactory pointer.
5060+
strat = bt->rewrite->strategyFactory->strategyInstance(name);
5061+
}
50615062

50625063
return static_cast<void const *>(strat);
50635064
}

0 commit comments

Comments
 (0)