Browse files

Clean up code from d3f6fb3

  • Loading branch information...
1 parent d3f6fb3 commit 8ffc053dfce9aeb911134442527002a5b45d5a2f @evanmiller committed Feb 21, 2014
Showing with 11 additions and 10 deletions.
  1. +11 −10 ngx_http_zip_module.c
View
21 ngx_http_zip_module.c
@@ -192,17 +192,18 @@ ngx_http_zip_main_request_header_filter(ngx_http_request_t *r)
return NGX_ERROR;
/* Look for X-Archive-Files */
- if ( !r->upstream && ( ngx_http_variable_unknown_header(vv, &ngx_http_zip_header_variable_name,
- &r->headers_out.headers.part,
- sizeof("upstream_http_") - 1) != NGX_OK)
- || vv->not_found || ngx_strncmp(vv->data, "zip", sizeof("zip") - 1) != 0){
-
- return ngx_http_next_header_filter(r);
-
- }else if (r->upstream && ngx_http_upstream_header_variable(r, vv,
- (uintptr_t)(&ngx_http_zip_header_variable_name)) != NGX_OK
- || vv->not_found || ngx_strncmp(vv->data, "zip", sizeof("zip") - 1) != 0){
+ ngx_int_t variable_header_status = NGX_OK;
+ if (r->upstream) {
+ variable_header_status = ngx_http_upstream_header_variable(r, vv,
+ (uintptr_t)(&ngx_http_zip_header_variable_name));
+ } else {
+ variable_header_status = ngx_http_variable_unknown_header(vv,
+ &ngx_http_zip_header_variable_name,
+ &r->headers_out.headers.part, sizeof("upstream_http_") - 1);
+ }
+ if (variable_header_status != NGX_OK || vv->not_found ||
+ ngx_strncmp(vv->data, "zip", sizeof("zip") - 1) != 0) {
return ngx_http_next_header_filter(r);
}

0 comments on commit 8ffc053

Please sign in to comment.