33
33
#include <ngx_http.h>
34
34
35
35
36
+ #ifndef nginx_version
37
+ #error This module cannot be build against an unknown nginx version.
38
+ #endif
39
+
40
+
36
41
#if (NGX_HTTP_CACHE )
37
42
38
43
typedef struct {
@@ -204,12 +209,12 @@ typedef struct {
204
209
ngx_array_t * fastcgi_lengths ;
205
210
ngx_array_t * fastcgi_values ;
206
211
207
- # if defined( nginx_version ) && (nginx_version >= 8040 )
212
+ # if (nginx_version >= 8040 )
208
213
ngx_hash_t headers_hash ;
209
214
ngx_uint_t header_params ;
210
215
# endif /* nginx_version >= 8040 */
211
216
212
- # if defined( nginx_version ) && (nginx_version >= 1001004 )
217
+ # if (nginx_version >= 1001004 )
213
218
ngx_flag_t keep_conn ;
214
219
# endif /* nginx_version >= 1001004 */
215
220
@@ -305,7 +310,7 @@ ngx_http_fastcgi_cache_purge_handler(ngx_http_request_t *r)
305
310
return NGX_HTTP_INTERNAL_SERVER_ERROR ;
306
311
}
307
312
308
- # if defined( nginx_version ) && (nginx_version >= 8011 )
313
+ # if (nginx_version >= 8011 )
309
314
r -> main -> count ++ ;
310
315
# endif
311
316
@@ -337,15 +342,15 @@ typedef struct {
337
342
ngx_hash_t headers_set_hash ;
338
343
339
344
ngx_array_t * headers_source ;
340
- # if defined( nginx_version ) && (nginx_version < 8040 )
345
+ # if (nginx_version < 8040 )
341
346
ngx_array_t * headers_names ;
342
347
# endif /* nginx_version < 8040 */
343
348
344
349
ngx_array_t * proxy_lengths ;
345
350
ngx_array_t * proxy_values ;
346
351
347
352
ngx_array_t * redirects ;
348
- # if defined( nginx_version ) && (nginx_version >= 1001015 )
353
+ # if (nginx_version >= 1001015 )
349
354
ngx_array_t * cookie_domains ;
350
355
ngx_array_t * cookie_paths ;
351
356
# endif /* nginx_version >= 1001015 */
@@ -362,20 +367,20 @@ typedef struct {
362
367
363
368
ngx_flag_t redirect ;
364
369
365
- # if defined( nginx_version ) && (nginx_version >= 1001004 )
370
+ # if (nginx_version >= 1001004 )
366
371
ngx_uint_t http_version ;
367
372
# endif /* nginx_version >= 1001004 */
368
373
369
374
ngx_uint_t headers_hash_max_size ;
370
375
ngx_uint_t headers_hash_bucket_size ;
371
376
372
377
# if (NGX_HTTP_SSL )
373
- # if defined( nginx_version ) && (nginx_version >= 1005006 )
378
+ # if (nginx_version >= 1005006 )
374
379
ngx_uint_t ssl ;
375
380
ngx_uint_t ssl_protocols ;
376
381
ngx_str_t ssl_ciphers ;
377
382
# endif /* nginx_version >= 1005006 */
378
- # if defined( nginx_version ) && (nginx_version >= 1007000 )
383
+ # if (nginx_version >= 1007000 )
379
384
ngx_uint_t ssl_verify_depth ;
380
385
ngx_str_t ssl_trusted_certificate ;
381
386
ngx_str_t ssl_crl ;
@@ -466,7 +471,7 @@ ngx_http_proxy_cache_purge_handler(ngx_http_request_t *r)
466
471
return NGX_HTTP_INTERNAL_SERVER_ERROR ;
467
472
}
468
473
469
- # if defined( nginx_version ) && (nginx_version >= 8011 )
474
+ # if (nginx_version >= 8011 )
470
475
r -> main -> count ++ ;
471
476
# endif
472
477
@@ -579,7 +584,7 @@ ngx_http_scgi_cache_purge_handler(ngx_http_request_t *r)
579
584
return NGX_HTTP_INTERNAL_SERVER_ERROR ;
580
585
}
581
586
582
- # if defined( nginx_version ) && (nginx_version >= 8011 )
587
+ # if (nginx_version >= 8011 )
583
588
r -> main -> count ++ ;
584
589
# endif
585
590
@@ -614,12 +619,12 @@ typedef struct {
614
619
ngx_uint_t modifier2 ;
615
620
616
621
# if (NGX_HTTP_SSL )
617
- # if defined( nginx_version ) && (nginx_version >= 1005008 )
622
+ # if (nginx_version >= 1005008 )
618
623
ngx_uint_t ssl ;
619
624
ngx_uint_t ssl_protocols ;
620
625
ngx_str_t ssl_ciphers ;
621
626
# endif /* nginx_version >= 1005008 */
622
- # if defined( nginx_version ) && (nginx_version >= 1007000 )
627
+ # if (nginx_version >= 1007000 )
623
628
ngx_uint_t ssl_verify_depth ;
624
629
ngx_str_t ssl_trusted_certificate ;
625
630
ngx_str_t ssl_crl ;
@@ -710,7 +715,7 @@ ngx_http_uwsgi_cache_purge_handler(ngx_http_request_t *r)
710
715
return NGX_HTTP_INTERNAL_SERVER_ERROR ;
711
716
}
712
717
713
- # if defined( nginx_version ) && (nginx_version >= 8011 )
718
+ # if (nginx_version >= 8011 )
714
719
r -> main -> count ++ ;
715
720
# endif
716
721
@@ -967,9 +972,8 @@ ngx_http_file_cache_purge(ngx_http_request_t *r)
967
972
switch (ngx_http_file_cache_open (r )) {
968
973
case NGX_OK :
969
974
case NGX_HTTP_CACHE_STALE :
970
- # if defined(nginx_version ) \
971
- && ((nginx_version >= 8001 ) \
972
- || ((nginx_version < 8000 ) && (nginx_version >= 7060 )))
975
+ # if (nginx_version >= 8001 ) \
976
+ || ((nginx_version < 8000 ) && (nginx_version >= 7060 ))
973
977
case NGX_HTTP_CACHE_UPDATING :
974
978
# endif
975
979
break ;
@@ -999,7 +1003,7 @@ ngx_http_file_cache_purge(ngx_http_request_t *r)
999
1003
return NGX_DECLINED ;
1000
1004
}
1001
1005
1002
- # if defined( nginx_version ) && (nginx_version >= 1000001 )
1006
+ # if (nginx_version >= 1000001 )
1003
1007
cache -> sh -> size -= c -> node -> fs_size ;
1004
1008
c -> node -> fs_size = 0 ;
1005
1009
# else
@@ -1008,9 +1012,8 @@ ngx_http_file_cache_purge(ngx_http_request_t *r)
1008
1012
# endif
1009
1013
1010
1014
c -> node -> exists = 0 ;
1011
- # if defined(nginx_version ) \
1012
- && ((nginx_version >= 8001 ) \
1013
- || ((nginx_version < 8000 ) && (nginx_version >= 7060 )))
1015
+ # if (nginx_version >= 8001 ) \
1016
+ || ((nginx_version < 8000 ) && (nginx_version >= 7060 ))
1014
1017
c -> node -> updating = 0 ;
1015
1018
# endif
1016
1019
0 commit comments