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

Method HandleUpdateCachedObject

src/proxy/http/HttpTransact.cc:3507–3533  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// Name : HandleUpdateCachedObject Description: called from the state machine when we are going to modify headers without any server contact. Details : this function does very little. mainly to satisfy the call_transact_and_set_next format and not affect the performance of the non-invalidate operations, which are the

Source from the content-addressed store, hash-verified

3505//
3506///////////////////////////////////////////////////////////////////////////////
3507void
3508HttpTransact::HandleUpdateCachedObject(State *s)
3509{
3510 if (s->cache_info.write_lock_state == HttpTransact::CACHE_WL_SUCCESS) {
3511 ink_assert(s->cache_info.object_store.valid());
3512 ink_assert(s->cache_info.object_store.response_get() != nullptr);
3513 ink_assert(s->cache_info.object_read != nullptr);
3514 ink_assert(s->cache_info.object_read->valid());
3515
3516 if (!s->cache_info.object_store.request_get()) {
3517 s->cache_info.object_store.request_set(s->cache_info.object_read->request_get());
3518 }
3519 s->request_sent_time = s->cache_info.object_read->request_sent_time_get();
3520 s->response_received_time = s->cache_info.object_read->response_received_time_get();
3521 if (s->api_update_cached_object == UPDATE_CACHED_OBJECT_CONTINUE) {
3522 TRANSACT_RETURN(SM_ACTION_CACHE_ISSUE_UPDATE, HttpTransact::HandleUpdateCachedObjectContinue);
3523 } else {
3524 TRANSACT_RETURN(SM_ACTION_CACHE_ISSUE_UPDATE, HttpTransact::HandleApiErrorJump);
3525 }
3526 } else if (s->api_update_cached_object == UPDATE_CACHED_OBJECT_CONTINUE) {
3527 // even failed to update, continue to serve from cache
3528 HandleUpdateCachedObjectContinue(s);
3529 } else {
3530 s->api_update_cached_object = UPDATE_CACHED_OBJECT_FAIL;
3531 HandleApiErrorJump(s);
3532 }
3533}
3534
3535void
3536HttpTransact::HandleUpdateCachedObjectContinue(State *s)

Callers

nothing calls this directly

Calls 6

response_getMethod · 0.80
request_getMethod · 0.80
request_setMethod · 0.80
request_sent_time_getMethod · 0.80
validMethod · 0.45

Tested by

no test coverage detected