Mercurial > hg > nginx
comparison src/http/ngx_http_spdy.c @ 5510:3ff29c30effb
SPDY: elimination of r->blocked counter usage for queuing frames.
It was used to prevent destroying of request object when there are unsent
frames in queue for the stream. Since it was incremented for each frame
and is only 8 bits long, so it was not very hard to overflow the counter.
Now the stream->queued counter is checked instead.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Tue, 14 Jan 2014 16:24:45 +0400 |
parents | 877a7bd72070 |
children | ec9e9da4c1fb |
comparison
equal
deleted
inserted
replaced
5509:877a7bd72070 | 5510:3ff29c30effb |
---|---|
2640 ngx_http_spdy_srv_conf_t *sscf; | 2640 ngx_http_spdy_srv_conf_t *sscf; |
2641 ngx_http_spdy_connection_t *sc; | 2641 ngx_http_spdy_connection_t *sc; |
2642 | 2642 |
2643 sc = stream->connection; | 2643 sc = stream->connection; |
2644 | 2644 |
2645 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0, | 2645 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0, |
2646 "spdy close stream %ui, processing %ui", | 2646 "spdy close stream %ui, queued %ui, processing %ui", |
2647 stream->id, sc->processing); | 2647 stream->id, stream->queued, sc->processing); |
2648 | |
2649 fc = stream->request->connection; | |
2650 | |
2651 if (stream->queued) { | |
2652 fc->write->handler = ngx_http_spdy_close_stream_handler; | |
2653 return; | |
2654 } | |
2648 | 2655 |
2649 if (!stream->out_closed) { | 2656 if (!stream->out_closed) { |
2650 if (ngx_http_spdy_send_rst_stream(sc, stream->id, | 2657 if (ngx_http_spdy_send_rst_stream(sc, stream->id, |
2651 NGX_SPDY_INTERNAL_ERROR, | 2658 NGX_SPDY_INTERNAL_ERROR, |
2652 stream->priority) | 2659 stream->priority) |
2682 break; | 2689 break; |
2683 } | 2690 } |
2684 | 2691 |
2685 index = &s->index; | 2692 index = &s->index; |
2686 } | 2693 } |
2687 | |
2688 fc = stream->request->connection; | |
2689 | 2694 |
2690 ngx_http_free_request(stream->request, rc); | 2695 ngx_http_free_request(stream->request, rc); |
2691 | 2696 |
2692 ev = fc->read; | 2697 ev = fc->read; |
2693 | 2698 |
2860 fc = r->connection; | 2865 fc = r->connection; |
2861 | 2866 |
2862 fc->error = 1; | 2867 fc->error = 1; |
2863 | 2868 |
2864 if (stream->queued) { | 2869 if (stream->queued) { |
2865 r->blocked -= stream->queued; | |
2866 stream->queued = 0; | 2870 stream->queued = 0; |
2867 | 2871 |
2868 ev = fc->write; | 2872 ev = fc->write; |
2869 ev->delayed = 0; | 2873 ev->delayed = 0; |
2870 | 2874 |