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

Function TSHttpTxnRedirectUrlSet

src/api/InkAPI.cc:6535–6557  ·  view source on GitHub ↗

this function should be called at TS_EVENT_HTTP_READ_RESPONSE_HDR

Source from the content-addressed store, hash-verified

6533
6534// this function should be called at TS_EVENT_HTTP_READ_RESPONSE_HDR
6535void
6536TSHttpTxnRedirectUrlSet(TSHttpTxn txnp, const char *url, const int url_len)
6537{
6538 sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
6539 sdk_assert(sdk_sanity_check_null_ptr((void *)url) == TS_SUCCESS);
6540
6541 HttpSM *sm = reinterpret_cast<HttpSM *>(txnp);
6542
6543 ats_free(sm->redirect_url);
6544 sm->redirect_url = nullptr;
6545 sm->redirect_url_len = 0;
6546
6547 sm->redirect_url = const_cast<char *>(url);
6548 sm->redirect_url_len = url_len;
6549 sm->enable_redirection = true;
6550 sm->redirection_tries = 0;
6551
6552 // Make sure we allow for at least one redirection.
6553 if (sm->t_state.txn_conf->number_of_redirections <= 0) {
6554 sm->t_state.setup_per_txn_configs();
6555 sm->t_state.my_txn_conf().number_of_redirections = 1;
6556 }
6557}
6558
6559const char *
6560TSHttpTxnRedirectUrlGet(TSHttpTxn txnp, int *url_len_ptr)

Callers 4

redirectToMethod · 0.85
EscalateResponseFunction · 0.85
handle_responseFunction · 0.85

Calls 4

sdk_sanity_check_txnFunction · 0.85
ats_freeFunction · 0.85
setup_per_txn_configsMethod · 0.80

Tested by

no test coverage detected