comparison src/event/ngx_event_pipe.c @ 328:26ff8d6b618d NGINX_0_5_34

nginx 0.5.34 *) Change: now the full request line instead of URI only is written to error_log. *) Feature: Cygwin compatibility. Thanks to Vladimir Kutakov. *) Feature: the "merge_slashes" directive. *) Feature: the "gzip_vary" directive. *) Feature: the "server_tokens" directive. *) Feature: the "access_log" directive may be used inside the "limit_except" block. *) Bugfix: if the $server_protocol was used in FastCGI parameters and a request line length was near to the "client_header_buffer_size" directive value, then nginx issued an alert "fastcgi: the request record is too big". *) Bugfix: if a plain text HTTP/0.9 version request was made to HTTPS server, then nginx returned usual response. *) Bugfix: URL double escaping in a redirect of the "msie_refresh" directive; bug appeared in 0.5.28. *) Bugfix: a segmentation fault might occur in worker process if subrequests were used. *) Bugfix: the big responses may be transferred truncated if SSL and gzip were used. *) Bugfix: compatibility with mget. *) Bugfix: nginx did not unescape URI in the "include" SSI command. *) Bugfix: the segmentation fault was occurred on start or while reconfiguration if variable was used in the "charset" or "source_charset" directives. *) Bugfix: nginx returned the 400 response on requests like "GET http://www.domain.com HTTP/1.0". Thanks to James Oakley. *) Bugfix: a segmentation fault occurred in worker process if $date_local and $date_gmt were used outside the ngx_http_ssi_filter_module. *) Bugfix: a segmentation fault might occur in worker process if debug log was enabled. Thanks to Andrei Nigmatulin. *) Bugfix: ngx_http_memcached_module did not set $upstream_response_time. Thanks to Maxim Dounin. *) Bugfix: a worker process may got caught in an endless loop, if the memcached was used.
author Igor Sysoev <http://sysoev.ru>
date Thu, 13 Dec 2007 00:00:00 +0300
parents f70f2f565fe0
children
comparison
equal deleted inserted replaced
327:cb962a94cd7b 328:26ff8d6b618d
190 } 190 }
191 191
192 chain->buf = b; 192 chain->buf = b;
193 chain->next = NULL; 193 chain->next = NULL;
194 194
195 } else if (!p->cachable 195 } else if (!p->cacheable
196 && p->downstream->data == p->output_ctx 196 && p->downstream->data == p->output_ctx
197 && p->downstream->write->ready 197 && p->downstream->write->ready
198 && !p->downstream->write->delayed) 198 && !p->downstream->write->delayed)
199 { 199 {
200 /* 200 /*
207 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0, 207 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
208 "pipe downstream ready"); 208 "pipe downstream ready");
209 209
210 break; 210 break;
211 211
212 } else if (p->cachable 212 } else if (p->cacheable
213 || p->temp_file->offset < p->max_temp_file_size) 213 || p->temp_file->offset < p->max_temp_file_size)
214 { 214 {
215 215
216 /* 216 /*
217 * if it is allowed, then save some bufs from r->in 217 * if it is allowed, then save some bufs from r->in
404 } 404 }
405 } 405 }
406 } 406 }
407 } 407 }
408 408
409 if (p->cachable && p->in) { 409 if (p->cacheable && p->in) {
410 if (ngx_event_pipe_write_chain_to_temp_file(p) == NGX_ABORT) { 410 if (ngx_event_pipe_write_chain_to_temp_file(p) == NGX_ABORT) {
411 return NGX_ABORT; 411 return NGX_ABORT;
412 } 412 }
413 } 413 }
414 414
419 static ngx_int_t 419 static ngx_int_t
420 ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) 420 ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
421 { 421 {
422 u_char *prev; 422 u_char *prev;
423 size_t bsize; 423 size_t bsize;
424 ngx_int_t rc;
424 ngx_uint_t flush, prev_last_shadow; 425 ngx_uint_t flush, prev_last_shadow;
425 ngx_chain_t *out, **ll, *cl; 426 ngx_chain_t *out, **ll, *cl;
426 ngx_connection_t *downstream; 427 ngx_connection_t *downstream;
427 428
428 downstream = p->downstream; 429 downstream = p->downstream;
449 450
450 for (cl = p->out; cl; cl = cl->next) { 451 for (cl = p->out; cl; cl = cl->next) {
451 cl->buf->recycled = 0; 452 cl->buf->recycled = 0;
452 } 453 }
453 454
454 if (p->output_filter(p->output_ctx, p->out) == NGX_ERROR) { 455 rc = p->output_filter(p->output_ctx, p->out);
456
457 if (downstream->destroyed) {
458 return NGX_ABORT;
459 }
460
461 if (rc == NGX_ERROR) {
455 p->downstream_error = 1; 462 p->downstream_error = 1;
456 return ngx_event_pipe_drain_chains(p); 463 return ngx_event_pipe_drain_chains(p);
457 } 464 }
458 465
459 p->out = NULL; 466 p->out = NULL;
465 472
466 for (cl = p->in; cl; cl = cl->next) { 473 for (cl = p->in; cl; cl = cl->next) {
467 cl->buf->recycled = 0; 474 cl->buf->recycled = 0;
468 } 475 }
469 476
470 if (p->output_filter(p->output_ctx, p->in) == NGX_ERROR) { 477 rc = p->output_filter(p->output_ctx, p->in);
471 478
472 if (downstream->destroyed) { 479 if (downstream->destroyed) {
473 return NGX_ABORT; 480 return NGX_ABORT;
474 } 481 }
475 482
483 if (rc == NGX_ERROR) {
476 p->downstream_error = 1; 484 p->downstream_error = 1;
477 return ngx_event_pipe_drain_chains(p); 485 return ngx_event_pipe_drain_chains(p);
478 } 486 }
479 487
480 p->in = NULL; 488 p->in = NULL;
540 548
541 p->out = p->out->next; 549 p->out = p->out->next;
542 550
543 ngx_event_pipe_free_shadow_raw_buf(&p->free_raw_bufs, cl->buf); 551 ngx_event_pipe_free_shadow_raw_buf(&p->free_raw_bufs, cl->buf);
544 552
545 } else if (!p->cachable && p->in) { 553 } else if (!p->cacheable && p->in) {
546 cl = p->in; 554 cl = p->in;
547 555
548 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, p->log, 0, 556 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, p->log, 0,
549 "pipe write buf ls:%d %p %z", 557 "pipe write buf ls:%d %p %z",
550 cl->buf->last_shadow, 558 cl->buf->last_shadow,
600 608
601 if (out == NULL && !flush) { 609 if (out == NULL && !flush) {
602 break; 610 break;
603 } 611 }
604 612
605 if (p->output_filter(p->output_ctx, out) == NGX_ERROR) { 613 rc = p->output_filter(p->output_ctx, out);
614
615 if (downstream->destroyed) {
616 return NGX_ABORT;
617 }
618
619 if (rc == NGX_ERROR) {
606 p->downstream_error = 1; 620 p->downstream_error = 1;
607 return ngx_event_pipe_drain_chains(p); 621 return ngx_event_pipe_drain_chains(p);
608 } 622 }
609 623
610 ngx_chain_update_chains(&p->free, &p->busy, &out, p->tag); 624 ngx_chain_update_chains(&p->free, &p->busy, &out, p->tag);
611 625
612 for (cl = p->free; cl; cl = cl->next) { 626 for (cl = p->free; cl; cl = cl->next) {
613 627
614 if (cl->buf->temp_file) { 628 if (cl->buf->temp_file) {
615 if (p->cachable || !p->cyclic_temp_file) { 629 if (p->cacheable || !p->cyclic_temp_file) {
616 continue; 630 continue;
617 } 631 }
618 632
619 /* reset p->temp_offset if all bufs had been sent */ 633 /* reset p->temp_offset if all bufs had been sent */
620 634
657 671
658 } else { 672 } else {
659 out = p->in; 673 out = p->in;
660 } 674 }
661 675
662 if (!p->cachable) { 676 if (!p->cacheable) {
663 677
664 size = 0; 678 size = 0;
665 cl = out; 679 cl = out;
666 ll = NULL; 680 ll = NULL;
667 681