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

Function TSHttpTxnReenable

src/api/InkAPI.cc:5026–5052  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

5024
5025//----------------------------------------------------------------------------
5026void
5027TSHttpTxnReenable(TSHttpTxn txnp, TSEvent event)
5028{
5029 sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
5030
5031 HttpSM *sm = reinterpret_cast<HttpSM *>(txnp);
5032 EThread *eth = this_ethread();
5033
5034 // TS-2271: If this function is being executed on a thread which was not
5035 // created using the ATS EThread API, eth will be null, and the
5036 // continuation needs to be called back on a REGULAR thread.
5037 //
5038 // If we are not coming from the thread associated with the state machine,
5039 // reschedule. Also reschedule if we cannot get the state machine lock.
5040 if (eth != nullptr && sm->getThreadAffinity() == eth) {
5041 MUTEX_TRY_LOCK(trylock, sm->mutex, eth);
5042 if (trylock.is_locked()) {
5043 ink_assert(eth->is_event_type(ET_NET));
5044 sm->state_api_callback(static_cast<int>(event), nullptr);
5045 return;
5046 }
5047 }
5048 // Couldn't call the handler directly, schedule to the original SM thread
5049 TSHttpSMCallback *cb = new TSHttpSMCallback(sm, event);
5050 cb->setThreadAffinity(sm->getThreadAffinity());
5051 eventProcessor.schedule_imm(cb, ET_NET);
5052}
5053
5054TSReturnCode TSUserArgIndexNameLookup(TSUserArgType type, const char *name, int *arg_idx, const char **description);
5055

Callers 15

handle_dnsFunction · 0.85
handle_responseFunction · 0.85
InterceptTxnHookFunction · 0.85
server_push_pluginFunction · 0.85
reenable_txnFunction · 0.85
handle_client_lookupFunction · 0.85
handle_responseFunction · 0.85
proto_stack_cbFunction · 0.85
transform_pluginFunction · 0.85
main_hookFunction · 0.85
request_buffer_pluginFunction · 0.85
global_pluginFunction · 0.85

Calls 7

sdk_sanity_check_txnFunction · 0.85
this_ethreadFunction · 0.85
getThreadAffinityMethod · 0.80
is_event_typeMethod · 0.80
state_api_callbackMethod · 0.80
setThreadAffinityMethod · 0.80
schedule_immMethod · 0.45

Tested by 15

mytest_handlerFunction · 0.68
ssn_handlerFunction · 0.68
parent_proxy_successFunction · 0.68
parent_proxy_handlerFunction · 0.68
cache_hook_handlerFunction · 0.68
transform_hook_handlerFunction · 0.68
altinfo_hook_handlerFunction · 0.68
cont_test_handlerFunction · 0.68
global_handlerFunction · 0.68
transactionContFuncFunction · 0.68
sessionContFuncFunction · 0.68
globalContFuncFunction · 0.68