MCPcopy Create free account
hub / github.com/apache/trafficserver / get_user_arg_offset

Function get_user_arg_offset

include/tscore/PluginUserArgs.h:56–62  ·  view source on GitHub ↗

Stagger each user argument value so we can detect mismatched * indices. * * For example, say a plugin associates data with both sessions and * transactions and that its session index is 2 and its transaction index is 4. * In this case, we'll hand back to the plugin 2002 for its session index and * 1004 for its transaction index. If it then accidentally uses its session * index to reference

Source from the content-addressed store, hash-verified

54 * That is, for a transaction, expect internally a value of 3 instead of 1003.
55 */
56static constexpr size_t
57get_user_arg_offset(TSUserArgType type)
58{
59 // TS_USER_ARGS_TXN indices begin at 1000, TS_USER_ARGS_SSN begin at 2000,
60 // etc.
61 return (static_cast<size_t>(type) + 1) * 1000;
62}
63
64/** Verify that the user passed in an index whose value corresponds with the
65 * type. See the comment above the declaration of get_user_arg_offset for the

Callers 7

TSUserArgIndexReserveFunction · 0.85
TSUserArgIndexLookupFunction · 0.85
TSUserArgIndexNameLookupFunction · 0.85
SanityCheckUserIndexFunction · 0.85
get_user_argMethod · 0.85
set_user_argMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected