Skip to content

Commit

Permalink
Fix compatibility with nginx-1.7.8+.
Browse files Browse the repository at this point in the history
Change-Id: Ia95af27d9e3f11b1132da3692d17042e63219d47
Signed-off-by: Piotr Sikora <[email protected]>
  • Loading branch information
PiotrSikora committed Dec 3, 2014
1 parent c31bf34 commit 68fd78a
Showing 1 changed file with 89 additions and 2 deletions.
91 changes: 89 additions & 2 deletions ngx_cache_purge_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,42 @@ CRLF "</center>" CRLF
# if (NGX_HTTP_FASTCGI)
extern ngx_module_t ngx_http_fastcgi_module;

# if (nginx_version >= 1007008)

typedef struct {
ngx_array_t *flushes;
ngx_array_t *lengths;
ngx_array_t *values;
ngx_uint_t number;
ngx_hash_t hash;
} ngx_http_fastcgi_params_t;

# endif /* nginx_version >= 1007008 */

typedef struct {
ngx_http_upstream_conf_t upstream;

ngx_str_t index;

# if (nginx_version >= 1007008)
ngx_http_fastcgi_params_t params;
ngx_http_fastcgi_params_t params_cache;
# else
ngx_array_t *flushes;
ngx_array_t *params_len;
ngx_array_t *params;
# endif /* nginx_version >= 1007008 */

ngx_array_t *params_source;
ngx_array_t *catch_stderr;

ngx_array_t *fastcgi_lengths;
ngx_array_t *fastcgi_values;

# if (nginx_version >= 8040)
# if (nginx_version >= 8040) && (nginx_version < 1007008)
ngx_hash_t headers_hash;
ngx_uint_t header_params;
# endif /* nginx_version >= 8040 */
# endif /* nginx_version >= 8040 && nginx_version < 1007008 */

# if (nginx_version >= 1001004)
ngx_flag_t keep_conn;
Expand Down Expand Up @@ -331,15 +349,36 @@ typedef struct {
ngx_str_t uri;
} ngx_http_proxy_vars_t;

# if (nginx_version >= 1007008)

typedef struct {
ngx_array_t *flushes;
ngx_array_t *lengths;
ngx_array_t *values;
ngx_hash_t hash;
} ngx_http_proxy_headers_t;

# endif /* nginx_version >= 1007008 */

typedef struct {
ngx_http_upstream_conf_t upstream;

# if (nginx_version >= 1007008)
ngx_array_t *body_flushes;
ngx_array_t *body_lengths;
ngx_array_t *body_values;
ngx_str_t body_source;

ngx_http_proxy_headers_t headers;
ngx_http_proxy_headers_t headers_cache;
# else
ngx_array_t *flushes;
ngx_array_t *body_set_len;
ngx_array_t *body_set;
ngx_array_t *headers_set_len;
ngx_array_t *headers_set;
ngx_hash_t headers_set_hash;
# endif /* nginx_version >= 1007008 */

ngx_array_t *headers_source;
# if (nginx_version < 8040)
Expand All @@ -355,7 +394,9 @@ typedef struct {
ngx_array_t *cookie_paths;
# endif /* nginx_version >= 1001015 */

# if (nginx_version < 1007008)
ngx_str_t body_source;
# endif /* nginx_version < 1007008 */

ngx_str_t method;
ngx_str_t location;
Expand Down Expand Up @@ -385,6 +426,11 @@ typedef struct {
ngx_str_t ssl_trusted_certificate;
ngx_str_t ssl_crl;
# endif /* nginx_version >= 1007000 */
# if (nginx_version >= 1007008)
ngx_str_t ssl_certificate;
ngx_str_t ssl_certificate_key;
ngx_array_t *ssl_passwords;
# endif /* nginx_version >= 1007008 */
# endif
} ngx_http_proxy_loc_conf_t;

Expand Down Expand Up @@ -484,16 +530,34 @@ ngx_http_proxy_cache_purge_handler(ngx_http_request_t *r)
# if (NGX_HTTP_SCGI)
extern ngx_module_t ngx_http_scgi_module;

# if (nginx_version >= 1007008)

typedef struct {
ngx_array_t *flushes;
ngx_array_t *lengths;
ngx_array_t *values;
ngx_uint_t number;
ngx_hash_t hash;
} ngx_http_scgi_params_t;

# endif /* nginx_version >= 1007008 */

typedef struct {
ngx_http_upstream_conf_t upstream;

# if (nginx_version >= 1007008)
ngx_http_scgi_params_t params;
ngx_http_scgi_params_t params_cache;
ngx_array_t *params_source;
# else
ngx_array_t *flushes;
ngx_array_t *params_len;
ngx_array_t *params;
ngx_array_t *params_source;

ngx_hash_t headers_hash;
ngx_uint_t header_params;
# endif /* nginx_version >= 1007008 */

ngx_array_t *scgi_lengths;
ngx_array_t *scgi_values;
Expand Down Expand Up @@ -597,16 +661,34 @@ ngx_http_scgi_cache_purge_handler(ngx_http_request_t *r)
# if (NGX_HTTP_UWSGI)
extern ngx_module_t ngx_http_uwsgi_module;

# if (nginx_version >= 1007008)

typedef struct {
ngx_array_t *flushes;
ngx_array_t *lengths;
ngx_array_t *values;
ngx_uint_t number;
ngx_hash_t hash;
} ngx_http_uwsgi_params_t;

# endif /* nginx_version >= 1007008 */

typedef struct {
ngx_http_upstream_conf_t upstream;

# if (nginx_version >= 1007008)
ngx_http_uwsgi_params_t params;
ngx_http_uwsgi_params_t params_cache;
ngx_array_t *params_source;
# else
ngx_array_t *flushes;
ngx_array_t *params_len;
ngx_array_t *params;
ngx_array_t *params_source;

ngx_hash_t headers_hash;
ngx_uint_t header_params;
# endif /* nginx_version >= 1007008 */

ngx_array_t *uwsgi_lengths;
ngx_array_t *uwsgi_values;
Expand All @@ -629,6 +711,11 @@ typedef struct {
ngx_str_t ssl_trusted_certificate;
ngx_str_t ssl_crl;
# endif /* nginx_version >= 1007000 */
# if (nginx_version >= 1007008)
ngx_str_t ssl_certificate;
ngx_str_t ssl_certificate_key;
ngx_array_t *ssl_passwords;
# endif /* nginx_version >= 1007008 */
# endif
} ngx_http_uwsgi_loc_conf_t;

Expand Down

0 comments on commit 68fd78a

Please sign in to comment.