Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/proxy/http/HttpCacheSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ struct HttpCacheAction : public Action {
{
sm = sm_arg;
};
void
reset()
{
cancelled = false;
}

HttpCacheSM *sm = nullptr;
};

Expand All @@ -64,6 +70,7 @@ class HttpCacheSM : public Continuation
mutex = amutex;
captive_action.init(this);
}
void reset();

Action *open_read(const HttpCacheKey *key, URL *url, HTTPHdr *hdr, const OverridableHttpConfigParams *params,
time_t pin_in_cache);
Expand Down
19 changes: 19 additions & 0 deletions src/proxy/http/HttpCacheSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,25 @@ HttpCacheSM::HttpCacheSM()
{
}

/**
Reset captive_action and counters for another cache operations.
- e.g. following redirect starts over from cache lookup
*/
void
HttpCacheSM::reset()
{
captive_action.reset();

open_read_tries = 0;
open_write_tries = 0;
open_write_start = 0;

lookup_max_recursive = 0;
current_lookup_level = 0;

err_code = 0;
}

//////////////////////////////////////////////////////////////////////////
//
// HttpCacheSM::state_cache_open_read()
Expand Down
3 changes: 3 additions & 0 deletions src/proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8540,6 +8540,9 @@ HttpSM::redirect_request(const char *arg_redirect_url, const int arg_redirect_le
}

dump_header(dbg_ctl_http_hdrs, &t_state.hdr_info.client_request, sm_id, "Framed Client Request..checking");

// Reset HttpCacheSM for new cache operations
cache_sm.reset();
}

void
Expand Down