Skip to content

Commit

Permalink
Check cache status in cache manager
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangwenyuan committed Mar 1, 2018
1 parent 1769d65 commit 1ddced1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
@@ -1,6 +1,6 @@
# Nuster Changelog

## 1.7.9.6 - 2018-02-28
## 1.7.9.6 - 2018-03-01

### Added
- Update ttl at run time
Expand Down
3 changes: 1 addition & 2 deletions src/cache/engine.c
Expand Up @@ -836,8 +836,7 @@ int cache_purge(struct stream *s, struct channel *req, struct proxy *px) {
struct http_msg *msg = &txn->req;


if(global.cache.status == CACHE_STATUS_ON &&
txn->meth == HTTP_METH_OTHER &&
if(txn->meth == HTTP_METH_OTHER &&
memcmp(msg->chn->buf->p, global.cache.purge_method, strlen(global.cache.purge_method)) == 0) {

char *key = cache_purge_build_key(s, msg);
Expand Down
2 changes: 1 addition & 1 deletion src/proto_http.c
Expand Up @@ -4357,7 +4357,7 @@ int http_process_req_common(struct stream *s, struct channel *req, int an_bit, s
}

/* check cache purge */
if (cache_purge(s, req, px) || cache_manager(s, req, px)) {
if (global.cache.status == CACHE_STATUS_ON && (cache_manager(s, req, px) || cache_purge(s, req, px))) {
goto return_prx_cond;
}

Expand Down

0 comments on commit 1ddced1

Please sign in to comment.