Skip to content

Commit 2e88b84

Browse files
committed
Fix build with nginx-0.8.0 and versions older than nginx-0.7.60.
Found by build farm for nginx modules.
1 parent 9e32c38 commit 2e88b84

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ngx_cache_purge_module.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,13 @@ ngx_http_file_cache_purge(ngx_http_request_t *r, ngx_http_file_cache_t *cache,
653653
ngx_http_file_cache_create_key(r);
654654

655655
rc = ngx_http_file_cache_open(r);
656+
# if defined(nginx_version) \
657+
&& ((nginx_version >= 8001) \
658+
|| ((nginx_version < 8000) && (nginx_version >= 7060)))
656659
if (rc == NGX_HTTP_CACHE_UPDATING || rc == NGX_HTTP_CACHE_STALE) {
660+
# else
661+
if (rc == NGX_HTTP_CACHE_STALE) {
662+
# endif
657663
rc = NGX_OK;
658664
}
659665

@@ -681,7 +687,11 @@ ngx_http_file_cache_purge(ngx_http_request_t *r, ngx_http_file_cache_t *cache,
681687
cache->sh->size -= (c->node->length + cache->bsize - 1) / cache->bsize;
682688

683689
c->node->exists = 0;
690+
# if defined(nginx_version) \
691+
&& ((nginx_version >= 8001) \
692+
|| ((nginx_version < 8000) && (nginx_version >= 7060)))
684693
c->node->updating = 0;
694+
# endif
685695

686696
ngx_shmtx_unlock(&cache->shpool->mutex);
687697

0 commit comments

Comments
 (0)