Re: Segmentation fault в DAV модуле
Dmitry Petrov
dmitry.petroff at gmail.com
Tue Nov 20 09:05:07 UTC 2012
On Mon, Nov 19, 2012 at 7:40 PM, Arnaud GRANAL <serphen at gmail.com> wrote:
> I guess it was fixed in a recent commit by Maxim:
> [..]
> diff --git a/src/http/modules/ngx_http_dav_module.c
> b/src/http/modules/ngx_http_dav_module.c
> --- a/src/http/modules/ngx_http_dav_module.c
> +++ b/src/http/modules/ngx_http_dav_module.c
> @@ -209,6 +209,11 @@ ngx_http_dav_put_handler(ngx_http_reques
> ngx_ext_rename_file_t ext;
> ngx_http_dav_loc_conf_t *dlcf;
>
> + if (r->request_body == NULL || r->request_body->temp_file == NULL) {
> + ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
> + return;
> + }
> +
> ngx_http_map_uri_to_path(r, &path, &root, 0);
>
> path.len--;
>
The problem is that I got this behavior on sequential valid PUT requests.
After handling first request, nginx even doesn't try to read body of next
request. It just calls ngx_http_dav_put_handler with r->response_body from
previous request but with r->response_body->temp_file set to NULL. With
extra check for temp_file not being NULL nginx actually reads second
request body and handles it properly.
--
Regards,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20121120/def66be3/attachment-0001.html>
More information about the nginx-devel
mailing list