Mercurial > hg > nginx
comparison src/http/modules/ngx_http_dav_module.c @ 7198:573f20116163
Dav: added error logging.
Previously, when request body was not available or was previously read in
memory rather than a file, client received HTTP 500 error, but no explanation
was logged in error log. This could happen, for example, if request body was
read or discarded prior to error_page redirect, or if mirroring was enabled
along with dav.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Wed, 07 Feb 2018 16:44:29 +0300 |
parents | 0cdee26605f3 |
children | 8e7a5de61664 |
comparison
equal
deleted
inserted
replaced
7197:ca8f8a443c11 | 7198:573f20116163 |
---|---|
211 ngx_uint_t status; | 211 ngx_uint_t status; |
212 ngx_file_info_t fi; | 212 ngx_file_info_t fi; |
213 ngx_ext_rename_file_t ext; | 213 ngx_ext_rename_file_t ext; |
214 ngx_http_dav_loc_conf_t *dlcf; | 214 ngx_http_dav_loc_conf_t *dlcf; |
215 | 215 |
216 if (r->request_body == NULL || r->request_body->temp_file == NULL) { | 216 if (r->request_body == NULL) { |
217 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
218 "PUT request body is unavailable"); | |
219 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | |
220 return; | |
221 } | |
222 | |
223 if (r->request_body->temp_file == NULL) { | |
224 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
225 "PUT request body must be in a file"); | |
217 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | 226 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
218 return; | 227 return; |
219 } | 228 } |
220 | 229 |
221 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) { | 230 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) { |