Skip to content

Commit f632a25

Browse files
committed
bugfix: compilation errors with nginx older than 0.9.2.
1 parent 2bcc996 commit f632a25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ngx_http_srcache_fetch.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ static ngx_int_t ngx_http_srcache_fetch_subrequest(ngx_http_request_t *r,
2020
ngx_http_srcache_loc_conf_t *conf, ngx_http_srcache_ctx_t *ctx);
2121
static ngx_int_t ngx_http_srcache_fetch_header_filter(ngx_http_request_t *r);
2222
static ngx_int_t ngx_http_srcache_test_not_modified(ngx_http_request_t *r);
23+
#if defined(nginx_version) && (nginx_version >= 9002)
2324
static ngx_int_t ngx_http_srcache_test_precondition(ngx_http_request_t *r);
25+
#endif
2426
static void ngx_http_srcache_post_read_body(ngx_http_request_t *r);
2527

2628

@@ -453,9 +455,11 @@ ngx_http_srcache_fetch_header_filter(ngx_http_request_t *r)
453455
return ngx_http_srcache_next_header_filter(r);
454456
}
455457

458+
#if defined(nginx_version) && (nginx_version >= 9002)
456459
if (r->headers_in.if_unmodified_since) {
457460
return ngx_http_srcache_test_precondition(r);
458461
}
462+
#endif
459463

460464
if (r->headers_in.if_modified_since) {
461465
return ngx_http_srcache_test_not_modified(r);
@@ -508,6 +512,7 @@ ngx_http_srcache_test_not_modified(ngx_http_request_t *r)
508512
}
509513

510514

515+
#if defined(nginx_version) && (nginx_version >= 9002)
511516
static ngx_int_t
512517
ngx_http_srcache_test_precondition(ngx_http_request_t *r)
513518
{
@@ -527,6 +532,7 @@ ngx_http_srcache_test_precondition(ngx_http_request_t *r)
527532
return ngx_http_filter_finalize_request(r, NULL,
528533
NGX_HTTP_PRECONDITION_FAILED);
529534
}
535+
#endif
530536

531537

532538
static void

0 commit comments

Comments
 (0)