mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
SPDY: avoid creating flush frames.
Previously, an empty frame object was created for an output chain that contains only sync or flush empty buffers. But since 39d7eef2e332 every DATA frame has the flush flag set on its last buffer, so there's no need any more in additional flush buffers in the output queue and they can be skipped. Note that such flush frames caused an incorrect $body_bytes_sent value.
This commit is contained in:
parent
a547f4ac15
commit
5cf11ab2e0
@ -625,6 +625,20 @@ ngx_http_spdy_send_chain(ngx_connection_t *fc, ngx_chain_t *in, off_t limit)
|
||||
r = fc->data;
|
||||
stream = r->spdy_stream;
|
||||
|
||||
#if (NGX_SUPPRESS_WARN)
|
||||
size = 0;
|
||||
#endif
|
||||
|
||||
while (in) {
|
||||
size = ngx_buf_size(in->buf);
|
||||
|
||||
if (size || in->buf->last_buf) {
|
||||
break;
|
||||
}
|
||||
|
||||
in = in->next;
|
||||
}
|
||||
|
||||
if (in == NULL) {
|
||||
|
||||
if (stream->queued) {
|
||||
@ -638,8 +652,6 @@ ngx_http_spdy_send_chain(ngx_connection_t *fc, ngx_chain_t *in, off_t limit)
|
||||
|
||||
sc = stream->connection;
|
||||
|
||||
size = ngx_buf_size(in->buf);
|
||||
|
||||
if (size && ngx_http_spdy_flow_control(sc, stream) == NGX_DECLINED) {
|
||||
fc->write->delayed = 1;
|
||||
return in;
|
||||
@ -850,8 +862,6 @@ ngx_http_spdy_filter_get_data_frame(ngx_http_spdy_stream_t *stream,
|
||||
"spdy:%ui create DATA frame %p: len:%uz flags:%ui",
|
||||
stream->id, frame, len, flags);
|
||||
|
||||
if (len || flags) {
|
||||
|
||||
cl = ngx_chain_get_free_buf(stream->request->pool,
|
||||
&stream->free_data_headers);
|
||||
if (cl == NULL) {
|
||||
@ -891,7 +901,6 @@ ngx_http_spdy_filter_get_data_frame(ngx_http_spdy_stream_t *stream,
|
||||
first = cl;
|
||||
|
||||
last->buf->flush = 1;
|
||||
}
|
||||
|
||||
frame->first = first;
|
||||
frame->last = last;
|
||||
|
Loading…
Reference in New Issue
Block a user