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

Method do_cache_prepare_update

src/proxy/http/HttpSM.cc:5090–5110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5088}
5089
5090void
5091HttpSM::do_cache_prepare_update()
5092{
5093 if (t_state.cache_info.object_read != nullptr && t_state.cache_info.object_read->valid() &&
5094 t_state.cache_info.object_store.valid() && t_state.cache_info.object_store.response_get() != nullptr &&
5095 t_state.cache_info.object_store.response_get()->valid() &&
5096 t_state.hdr_info.client_request.method_get_wksidx() == HTTP_WKSIDX_GET) {
5097 t_state.cache_info.object_store.request_set(t_state.cache_info.object_read->request_get());
5098 // t_state.cache_info.object_read = NULL;
5099 // cache_sm.close_read();
5100
5101 t_state.transact_return_point = HttpTransact::HandleUpdateCachedObject;
5102 ink_assert(cache_sm.cache_write_vc == nullptr);
5103 HTTP_SM_SET_DEFAULT_HANDLER(&HttpSM::state_cache_open_write);
5104 // don't retry read for update
5105 do_cache_prepare_action(&cache_sm, t_state.cache_info.object_read, false);
5106 } else {
5107 t_state.api_modifiable_cached_resp = false;
5108 call_transact_and_set_next_state(HttpTransact::HandleApiErrorJump);
5109 }
5110}
5111
5112void
5113HttpSM::do_cache_prepare_action(HttpCacheSM *c_sm, CacheHTTPInfo *object_read_info, bool retry, bool allow_multiple)

Callers

nothing calls this directly

Calls 5

response_getMethod · 0.80
method_get_wksidxMethod · 0.80
request_setMethod · 0.80
request_getMethod · 0.80
validMethod · 0.45

Tested by

no test coverage detected