----------------------------------------------------------------------------
| 5024 | |
| 5025 | //---------------------------------------------------------------------------- |
| 5026 | void |
| 5027 | TSHttpTxnReenable(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 | |
| 5054 | TSReturnCode TSUserArgIndexNameLookup(TSUserArgType type, const char *name, int *arg_idx, const char **description); |
| 5055 |