diff options
| author | Sergey Kandaurov <pluknet@nginx.com> | 2013-07-30 11:43:21 +0400 |
|---|---|---|
| committer | Sergey Kandaurov <pluknet@nginx.com> | 2013-07-30 11:43:21 +0400 |
| commit | 30091e8b38eb54639cc19ea5d2812f767c1be4c3 (patch) | |
| tree | 0947ee62fbe9588f2044e8a4673b9b0633d72cab /src | |
| parent | 6f05c095a885b8834df0b5c2310e8dd528187a5a (diff) | |
| download | nginx-30091e8b38eb54639cc19ea5d2812f767c1be4c3.tar.gz nginx-30091e8b38eb54639cc19ea5d2812f767c1be4c3.tar.bz2 | |
Autoindex: return NGX_ERROR on error if headers were sent.
This prevents ngx_http_finalize_request() from issuing
ngx_http_special_response_handler() on a freed context.
Diffstat (limited to 'src')
| -rw-r--r-- | src/http/modules/ngx_http_autoindex_module.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c index fb46d65d1..222ac728c 100644 --- a/src/http/modules/ngx_http_autoindex_module.c +++ b/src/http/modules/ngx_http_autoindex_module.c @@ -388,7 +388,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r) b = ngx_create_temp_buf(r->pool, len); if (b == NULL) { - return NGX_HTTP_INTERNAL_SERVER_ERROR; + return NGX_ERROR; } if (entries.nelts > 1) { @@ -649,7 +649,7 @@ ngx_http_autoindex_error(ngx_http_request_t *r, ngx_dir_t *dir, ngx_str_t *name) ngx_close_dir_n " \"%V\" failed", name); } - return NGX_HTTP_INTERNAL_SERVER_ERROR; + return r->header_sent ? NGX_ERROR : NGX_HTTP_INTERNAL_SERVER_ERROR; } |
