Initialize headers_out.status to NGX_OK and improve error check

When issuing subrequests (currently for non-builtin headers and footers),
initialize the headers_out.status field to NGX_OK.

Also, change the check of the result from ngx_http_send_header() to only
check for NGX_OK, as it is redundant to check it and also NGX_ERROR.
pull/4/head
Adrian Perez 2012-03-14 00:54:31 +02:00
parent ea6323f92c
commit 2034d0ad35
1 changed files with 2 additions and 4 deletions

View File

@ -762,17 +762,15 @@ ngx_http_fancyindex_handler(ngx_http_request_t *r)
out[0].buf->last_in_chain = 1;
r->headers_out.status = NGX_HTTP_OK;
r->headers_out.status = NGX_OK;
r->headers_out.content_type_len = ngx_sizeof_ssz("text/html");
r->headers_out.content_type.len = ngx_sizeof_ssz("text/html");
r->headers_out.content_type.data = (u_char *) "text/html";
rc = ngx_http_send_header(r);
if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
if (rc != NGX_OK || r->header_only)
return rc;
}
if (alcf->header.len > 0) {
/* URI is configured, make Nginx take care of with a subrequest. */