comparison src/http/ngx_http_core_module.c @ 179:9f3a78b06c48

nginx-0.0.1-2003-11-11-21:13:43 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 11 Nov 2003 18:13:43 +0000
parents a8ff48d26cca
children 4c698194c56d
comparison
equal deleted inserted replaced
178:a8ff48d26cca 179:9f3a78b06c48
427 { 427 {
428 if (r->main) { 428 if (r->main) {
429 return NGX_OK; 429 return NGX_OK;
430 } 430 }
431 431
432 if (r->err_status) { 432 if (r->err_ctx) {
433 r->headers_out.status = r->err_status; 433 r->headers_out.status = r->err_status;
434 r->headers_out.status_line.len = 0; 434 r->headers_out.status_line.len = 0;
435 } 435 }
436 436
437 return (*ngx_http_top_header_filter)(r); 437 return (*ngx_http_top_header_filter)(r);
497 } else if (uri->data[i] == '/') { 497 } else if (uri->data[i] == '/') {
498 break; 498 break;
499 } 499 }
500 } 500 }
501 501
502 /* clear the modules contexts */ 502 if (r->err_ctx) {
503 503
504 if (r->error_page) { 504 /* allocate the new modules contexts */
505 r->err_status = r->headers_out.status; 505
506 r->err_ctx = r->ctx;
507 r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module); 506 r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
508 if (r->ctx == NULL) { 507 if (r->ctx == NULL) {
509 return NGX_HTTP_INTERNAL_SERVER_ERROR; 508 return NGX_HTTP_INTERNAL_SERVER_ERROR;
510 } 509 }
511 510
512 } else { 511 } else {
512
513 /* clear the modules contexts */
514
513 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); 515 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
514 } 516 }
515 517
516 r->phase = 0; 518 r->phase = 0;
517 r->phase_handler = 0; 519 r->phase_handler = 0;