Mercurial > hg > nginx-quic
comparison src/http/ngx_http_spdy_filter_module.c @ 5494:27f9d5f68c1c
SPDY: refactored loop in ngx_http_spdy_body_filter().
No functional changes.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Thu, 26 Dec 2013 17:03:16 +0400 |
parents | 916cb6d28f6a |
children | 97f6cd787766 |
comparison
equal
deleted
inserted
replaced
5493:916cb6d28f6a | 5494:27f9d5f68c1c |
---|---|
616 static ngx_int_t | 616 static ngx_int_t |
617 ngx_http_spdy_body_filter(ngx_http_request_t *r, ngx_chain_t *in) | 617 ngx_http_spdy_body_filter(ngx_http_request_t *r, ngx_chain_t *in) |
618 { | 618 { |
619 off_t size; | 619 off_t size; |
620 ngx_buf_t *b; | 620 ngx_buf_t *b; |
621 ngx_chain_t *cl, *ll, *out, **ln; | 621 ngx_chain_t *cl, *out, **ln; |
622 ngx_http_spdy_stream_t *stream; | 622 ngx_http_spdy_stream_t *stream; |
623 ngx_http_spdy_out_frame_t *frame; | 623 ngx_http_spdy_out_frame_t *frame; |
624 | 624 |
625 stream = r->spdy_stream; | 625 stream = r->spdy_stream; |
626 | 626 |
642 return NGX_OK; | 642 return NGX_OK; |
643 } | 643 } |
644 | 644 |
645 size = 0; | 645 size = 0; |
646 ln = &out; | 646 ln = &out; |
647 ll = in; | 647 |
648 | 648 do { |
649 for ( ;; ) { | 649 b = in->buf; |
650 b = ll->buf; | |
651 #if 1 | 650 #if 1 |
652 if (ngx_buf_size(b) == 0 && !ngx_buf_special(b)) { | 651 if (ngx_buf_size(b) == 0 && !ngx_buf_special(b)) { |
653 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, | 652 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, |
654 "zero size buf in spdy body filter " | 653 "zero size buf in spdy body filter " |
655 "t:%d r:%d f:%d %p %p-%p %p %O-%O", | 654 "t:%d r:%d f:%d %p %p-%p %p %O-%O", |
676 cl->buf = b; | 675 cl->buf = b; |
677 | 676 |
678 *ln = cl; | 677 *ln = cl; |
679 ln = &cl->next; | 678 ln = &cl->next; |
680 | 679 |
681 if (ll->next == NULL) { | 680 in = in->next; |
682 break; | 681 |
683 } | 682 } while (in); |
684 | |
685 ll = ll->next; | |
686 } | |
687 | 683 |
688 if (size > NGX_SPDY_MAX_FRAME_SIZE) { | 684 if (size > NGX_SPDY_MAX_FRAME_SIZE) { |
689 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, | 685 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0, |
690 "FIXME: chain too big in spdy filter: %O", size); | 686 "FIXME: chain too big in spdy filter: %O", size); |
691 return NGX_ERROR; | 687 return NGX_ERROR; |