diff --git a/include/proxy/http/HttpSM.h b/include/proxy/http/HttpSM.h index c2128eeca20..99e0e09dc52 100644 --- a/include/proxy/http/HttpSM.h +++ b/include/proxy/http/HttpSM.h @@ -429,6 +429,8 @@ class HttpSM : public Continuation, public PluginUserArgs void do_drain_request_body(HTTPHdr &response); void wait_for_full_body(); + void generate_cache_key(HttpCacheKey *key, URL *url); + void generate_cache_key92(HttpCacheKey *key, URL *url); virtual void handle_api_return(); void handle_server_setup_error(int event, void *data); diff --git a/src/proxy/http/HttpSM.cc b/src/proxy/http/HttpSM.cc index 54c9e98f967..1a25b84fe23 100644 --- a/src/proxy/http/HttpSM.cc +++ b/src/proxy/http/HttpSM.cc @@ -888,6 +888,18 @@ HttpSM::wait_for_full_body() tunnel.tunnel_run(p); } +void +HttpSM::generate_cache_key(HttpCacheKey *key, URL *url) +{ + Cache::generate_key(key, url, t_state.txn_conf->cache_ignore_query, t_state.txn_conf->cache_generation_number); +} + +void +HttpSM::generate_cache_key92(HttpCacheKey *key, URL *url) +{ + Cache::generate_key92(key, url, t_state.txn_conf->cache_ignore_query, t_state.txn_conf->cache_generation_number); +} + int HttpSM::state_watch_for_client_abort(int event, void *data) { @@ -5322,9 +5334,9 @@ HttpSM::do_cache_lookup_and_read() HttpCacheKey key; if (compatibility_cache_lookup == CompatibilityCacheLookup::COMPAT_CACHE_LOOKUP_92) { - Cache::generate_key92(&key, c_url, t_state.txn_conf->cache_ignore_query, t_state.txn_conf->cache_generation_number); + generate_cache_key92(&key, c_url); } else { - Cache::generate_key(&key, c_url, t_state.txn_conf->cache_ignore_query, t_state.txn_conf->cache_generation_number); + generate_cache_key(&key, c_url); } t_state.hdr_info.cache_request.copy(&t_state.hdr_info.client_request); @@ -5352,8 +5364,7 @@ HttpSM::do_cache_delete_all_alts() SMDbg(dbg_ctl_http_seq, "Issuing cache delete for %s", t_state.cache_info.lookup_url->string_get_ref()); HttpCacheKey key; - Cache::generate_key(&key, t_state.cache_info.lookup_url, t_state.txn_conf->cache_ignore_query, - t_state.txn_conf->cache_generation_number); + generate_cache_key(&key, t_state.cache_info.lookup_url); cacheProcessor.remove(nullptr, &key); } @@ -5430,7 +5441,7 @@ HttpSM::do_cache_prepare_action(HttpCacheSM *c_sm, CacheHTTPInfo *object_read_in SMDbg(dbg_ctl_http_cache_write, "writing to cache with URL %s", s_url->string_get(&t_state.arena)); HttpCacheKey key; - Cache::generate_key(&key, s_url, t_state.txn_conf->cache_ignore_query, t_state.txn_conf->cache_generation_number); + generate_cache_key(&key, s_url); pending_action = c_sm->open_write(&key, s_url, &t_state.hdr_info.cache_request, object_read_info,