comparison src/http/modules/ngx_http_static_module.c @ 112:408f195b3482 NGINX_0_3_3

nginx 0.3.3 *) Change: the "bl" and "af" parameters of the "listen" directive was renamed to the "backlog" and "accept_filter". *) Feature: the "rcvbuf" and "sndbuf" parameters of the "listen" directive. *) Change: the "$msec" log parameter does not require now the additional the gettimeofday() system call. *) Feature: the -t switch now tests the "listen" directives. *) Bugfix: if the invalid address was specified in the "listen" directive, then after the -HUP signal nginx left an open socket in the CLOSED state. *) Bugfix: the mime type may be incorrectly set to default value for index file with variable in the name; bug appeared in 0.3.0. *) Feature: the "timer_resolution" directive. *) Feature: the millisecond "$upstream_response_time" log parameter. *) Bugfix: a temporary file with client request body now is removed just after the response header was transferred to a client. *) Bugfix: OpenSSL 0.9.6 compatibility. *) Bugfix: the SSL certificate and key file paths could not be relative. *) Bugfix: the "ssl_prefer_server_ciphers" directive did not work in the ngx_imap_ssl_module. *) Bugfix: the "ssl_protocols" directive allowed to specify the single protocol only.
author Igor Sysoev <http://sysoev.ru>
date Wed, 19 Oct 2005 00:00:00 +0400
parents 45f7329b4bd0
children d25a1d6034f1
comparison
equal deleted inserted replaced
111:a175b609c76d 112:408f195b3482
80 ngx_err_t err; 80 ngx_err_t err;
81 ngx_log_t *log; 81 ngx_log_t *log;
82 ngx_buf_t *b; 82 ngx_buf_t *b;
83 ngx_chain_t out; 83 ngx_chain_t out;
84 ngx_file_info_t fi; 84 ngx_file_info_t fi;
85 ngx_pool_cleanup_file_t *cln; 85 ngx_pool_cleanup_t *cln;
86 ngx_pool_cleanup_file_t *clnf;
86 ngx_http_core_loc_conf_t *clcf; 87 ngx_http_core_loc_conf_t *clcf;
87 88
88 if (r->uri.data[r->uri.len - 1] == '/') { 89 if (r->uri.data[r->uri.len - 1] == '/') {
89 return NGX_DECLINED; 90 return NGX_DECLINED;
90 } 91 }
116 return NGX_HTTP_INTERNAL_SERVER_ERROR; 117 return NGX_HTTP_INTERNAL_SERVER_ERROR;
117 } 118 }
118 119
119 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, 120 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
120 "http filename: \"%s\"", path.data); 121 "http filename: \"%s\"", path.data);
122
123 cln = ngx_pool_cleanup_add(r->pool, sizeof(ngx_pool_cleanup_file_t));
124 if (cln == NULL) {
125 return NGX_HTTP_INTERNAL_SERVER_ERROR;
126 }
121 127
122 fd = ngx_open_file(path.data, NGX_FILE_RDONLY, NGX_FILE_OPEN); 128 fd = ngx_open_file(path.data, NGX_FILE_RDONLY, NGX_FILE_OPEN);
123 129
124 if (fd == NGX_INVALID_FILE) { 130 if (fd == NGX_INVALID_FILE) {
125 err = ngx_errno; 131 err = ngx_errno;
221 227
222 #endif 228 #endif
223 229
224 log->action = "sending response to client"; 230 log->action = "sending response to client";
225 231
226 cln = ngx_palloc(r->pool, sizeof(ngx_pool_cleanup_file_t)); 232 cln->handler = ngx_pool_cleanup_file;
227 if (cln == NULL) { 233 clnf = cln->data;
228 return NGX_HTTP_INTERNAL_SERVER_ERROR; 234
229 } 235 clnf->fd = fd;
230 236 clnf->name = path.data;
231 cln->fd = fd; 237 clnf->log = r->pool->log;
232 cln->name = path.data;
233 cln->log = r->pool->log;
234
235 if (ngx_pool_cleanup_add(r->pool, ngx_pool_cleanup_file, cln) == NULL) {
236 return NGX_HTTP_INTERNAL_SERVER_ERROR;
237 }
238 238
239 r->headers_out.status = NGX_HTTP_OK; 239 r->headers_out.status = NGX_HTTP_OK;
240 r->headers_out.content_length_n = ngx_file_size(&fi); 240 r->headers_out.content_length_n = ngx_file_size(&fi);
241 r->headers_out.last_modified_time = ngx_file_mtime(&fi); 241 r->headers_out.last_modified_time = ngx_file_mtime(&fi);
242 242