comparison src/http/modules/ngx_http_index_handler.c @ 10:46833bd150cb NGINX_0_1_5

nginx 0.1.5 *) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
author Igor Sysoev <http://sysoev.ru>
date Thu, 11 Nov 2004 00:00:00 +0300
parents 80ba094c6b3e
children 6f8b0dc0f8dd
comparison
equal deleted inserted replaced
9:77eee314ddbd 10:46833bd150cb
141 if (ilcf->index_cache) { 141 if (ilcf->index_cache) {
142 ctx->cache = ngx_http_cache_get(ilcf->index_cache, NULL, 142 ctx->cache = ngx_http_cache_get(ilcf->index_cache, NULL,
143 &r->uri, &crc); 143 &r->uri, &crc);
144 144
145 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, 145 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
146 "http index cache get: " PTR_FMT, ctx->cache); 146 "http index cache get: %p", ctx->cache);
147 147
148 if (ctx->cache && !ctx->cache->expired) { 148 if (ctx->cache && !ctx->cache->expired) {
149 149
150 ctx->cache->accessed = ngx_cached_time; 150 ctx->cache->accessed = ngx_cached_time;
151 151
249 249
250 if (fd == NGX_INVALID_FILE) { 250 if (fd == NGX_INVALID_FILE) {
251 err = ngx_errno; 251 err = ngx_errno;
252 252
253 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, err, 253 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, err,
254 ngx_open_file_n " %s failed", name); 254 ngx_open_file_n " \"%s\" failed", name);
255 255
256 if (err == NGX_ENOTDIR) { 256 if (err == NGX_ENOTDIR) {
257 return ngx_http_index_error(r, ctx, err); 257 return ngx_http_index_error(r, ctx, err);
258 258
259 } else if (err == NGX_EACCES) { 259 } else if (err == NGX_EACCES) {
273 if (err == NGX_ENOENT) { 273 if (err == NGX_ENOENT) {
274 continue; 274 continue;
275 } 275 }
276 276
277 ngx_log_error(NGX_LOG_ERR, log, err, 277 ngx_log_error(NGX_LOG_ERR, log, err,
278 ngx_open_file_n " %s failed", name); 278 ngx_open_file_n " \"%s\" failed", name);
279 279
280 return NGX_HTTP_INTERNAL_SERVER_ERROR; 280 return NGX_HTTP_INTERNAL_SERVER_ERROR;
281 } 281 }
282 282
283 283
329 NULL, &r->uri, crc, 329 NULL, &r->uri, crc,
330 &ctx->redirect, log); 330 &ctx->redirect, log);
331 ctx->redirect.len--; 331 ctx->redirect.len--;
332 332
333 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, 333 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
334 "http index cache alloc: " PTR_FMT, ctx->cache); 334 "http index cache alloc: %p", ctx->cache);
335 335
336 if (ctx->cache) { 336 if (ctx->cache) {
337 ctx->cache->fd = NGX_INVALID_FILE; 337 ctx->cache->fd = NGX_INVALID_FILE;
338 ctx->cache->accessed = ngx_cached_time; 338 ctx->cache->accessed = ngx_cached_time;
339 ctx->cache->last_modified = 0; 339 ctx->cache->last_modified = 0;
371 ctx->path.data[ctx->path.len - 1] = '/'; 371 ctx->path.data[ctx->path.len - 1] = '/';
372 return ngx_http_index_error(r, ctx, err); 372 return ngx_http_index_error(r, ctx, err);
373 } 373 }
374 374
375 ngx_log_error(NGX_LOG_CRIT, r->connection->log, err, 375 ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
376 ngx_file_info_n " %s failed", ctx->path.data); 376 ngx_file_info_n " \"%s\" failed", ctx->path.data);
377 377
378 return NGX_HTTP_INTERNAL_SERVER_ERROR; 378 return NGX_HTTP_INTERNAL_SERVER_ERROR;
379 } 379 }
380 380
381 ctx->path.data[ctx->path.len - 1] = '/'; 381 ctx->path.data[ctx->path.len - 1] = '/';
500 500
501 value = cf->args->elts; 501 value = cf->args->elts;
502 502
503 if (value[1].data[0] == '/' && ilcf->indices.nelts == 0) { 503 if (value[1].data[0] == '/' && ilcf->indices.nelts == 0) {
504 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 504 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
505 "first index \"%s\" in \"%s\" directive " 505 "first index \"%V\" in \"%V\" directive "
506 "must not be absolute", 506 "must not be absolute",
507 value[1].data, cmd->name.data); 507 &value[1], &cmd->name);
508 return NGX_CONF_ERROR; 508 return NGX_CONF_ERROR;
509 } 509 }
510 510
511 for (i = 1; i < cf->args->nelts; i++) { 511 for (i = 1; i < cf->args->nelts; i++) {
512 if (value[i].len == 0) { 512 if (value[i].len == 0) {
513 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 513 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
514 "index \"%s\" in \"%s\" directive is invalid", 514 "index \"%V\" in \"%V\" directive is invalid",
515 value[1].data, cmd->name.data); 515 &value[1], &cmd->name);
516 return NGX_CONF_ERROR; 516 return NGX_CONF_ERROR;
517 } 517 }
518 518
519 ngx_test_null(index, ngx_push_array(&ilcf->indices), NGX_CONF_ERROR); 519 ngx_test_null(index, ngx_push_array(&ilcf->indices), NGX_CONF_ERROR);
520 index->len = value[i].len; 520 index->len = value[i].len;