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

Function TSHttpTxnCacheLookupUrlSet

src/api/InkAPI.cc:4351–4381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4349}
4350
4351TSReturnCode
4352TSHttpTxnCacheLookupUrlSet(TSHttpTxn txnp, TSMBuffer bufp, TSMLoc obj)
4353{
4354 sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
4355 sdk_assert(sdk_sanity_check_mbuffer(bufp) == TS_SUCCESS);
4356 sdk_assert(sdk_sanity_check_url_handle(obj) == TS_SUCCESS);
4357
4358 HttpSM *sm = reinterpret_cast<HttpSM *>(txnp);
4359 URL u, *l_url;
4360
4361 u.m_heap = (reinterpret_cast<HdrHeapSDKHandle *>(bufp))->m_heap;
4362 u.m_url_impl = reinterpret_cast<URLImpl *>(obj);
4363 if (!u.valid()) {
4364 return TS_ERROR;
4365 }
4366
4367 l_url = sm->t_state.cache_info.lookup_url;
4368 if (!l_url) {
4369 sm->t_state.cache_info.lookup_url_storage.create(nullptr);
4370 sm->t_state.cache_info.lookup_url = &(sm->t_state.cache_info.lookup_url_storage);
4371 l_url = sm->t_state.cache_info.lookup_url;
4372 }
4373
4374 if (!l_url || !l_url->valid()) {
4375 return TS_ERROR;
4376 } else {
4377 l_url->copy(&u);
4378 }
4379
4380 return TS_SUCCESS;
4381}
4382
4383/**
4384 * timeout is in msec

Callers 2

_updateMethod · 0.85

Calls 6

sdk_sanity_check_txnFunction · 0.85
sdk_sanity_check_mbufferFunction · 0.85
validMethod · 0.45
createMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected