summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_spdy.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2014-01-22 04:58:19 +0400
committerValentin Bartenev <vbart@nginx.com>2014-01-22 04:58:19 +0400
commit3ddf9ccfce12454dfa456d3ef5c92f7472966ebf (patch)
tree80f04b004534ba2b879d6c49227d2f30816c72a4 /src/http/ngx_http_spdy.c
parente62156d8292eb288ad456d6ba1eb96db7ce2a6b6 (diff)
downloadnginx-3ddf9ccfce12454dfa456d3ef5c92f7472966ebf.tar.gz
nginx-3ddf9ccfce12454dfa456d3ef5c92f7472966ebf.tar.bz2
SPDY: store the length of frame instead of its whole size.
The "length" value better corresponds with the specification and reduces confusion about whether frame's header is included in "size" or not. Also this change simplifies some parts of code, since in more cases the length of frame is more useful than its actual size, especially considering that the size of frame header is constant.
Diffstat (limited to 'src/http/ngx_http_spdy.c')
-rw-r--r--src/http/ngx_http_spdy.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c
index b5aa9931c..accfcb1d4 100644
--- a/src/http/ngx_http_spdy.c
+++ b/src/http/ngx_http_spdy.c
@@ -494,9 +494,9 @@ ngx_http_spdy_send_output_queue(ngx_http_spdy_connection_t *sc)
out = frame;
ngx_log_debug5(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "spdy frame out: %p sid:%ui prio:%ui bl:%d size:%uz",
+ "spdy frame out: %p sid:%ui prio:%ui bl:%d len:%uz",
out, out->stream ? out->stream->id : 0, out->priority,
- out->blocked, out->size);
+ out->blocked, out->length);
}
cl = c->send_chain(c, cl, 0);
@@ -537,9 +537,9 @@ ngx_http_spdy_send_output_queue(ngx_http_spdy_connection_t *sc)
}
ngx_log_debug4(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "spdy frame sent: %p sid:%ui bl:%d size:%uz",
+ "spdy frame sent: %p sid:%ui bl:%d len:%uz",
out, out->stream ? out->stream->id : 0,
- out->blocked, out->size);
+ out->blocked, out->length);
}
frame = NULL;
@@ -1587,9 +1587,7 @@ ngx_http_spdy_send_settings(ngx_http_spdy_connection_t *sc)
frame->handler = ngx_http_spdy_settings_frame_handler;
frame->stream = NULL;
#if (NGX_DEBUG)
- frame->size = NGX_SPDY_FRAME_HEADER_SIZE
- + NGX_SPDY_SETTINGS_NUM_SIZE
- + NGX_SPDY_SETTINGS_PAIR_SIZE;
+ frame->length = NGX_SPDY_SETTINGS_NUM_SIZE + NGX_SPDY_SETTINGS_PAIR_SIZE;
#endif
frame->priority = NGX_SPDY_HIGHEST_PRIORITY;
frame->blocked = 0;
@@ -1637,7 +1635,7 @@ ngx_http_spdy_settings_frame_handler(ngx_http_spdy_connection_t *sc,
static ngx_http_spdy_out_frame_t *
-ngx_http_spdy_get_ctl_frame(ngx_http_spdy_connection_t *sc, size_t size,
+ngx_http_spdy_get_ctl_frame(ngx_http_spdy_connection_t *sc, size_t length,
ngx_uint_t priority)
{
ngx_chain_t *cl;
@@ -1677,13 +1675,13 @@ ngx_http_spdy_get_ctl_frame(ngx_http_spdy_connection_t *sc, size_t size,
}
#if (NGX_DEBUG)
- if (size > NGX_SPDY_CTL_FRAME_BUFFER_SIZE - NGX_SPDY_FRAME_HEADER_SIZE) {
+ if (length > NGX_SPDY_CTL_FRAME_BUFFER_SIZE - NGX_SPDY_FRAME_HEADER_SIZE) {
ngx_log_error(NGX_LOG_ALERT, sc->pool->log, 0,
- "requested control frame is too big: %uz", size);
+ "requested control frame is too big: %uz", length);
return NULL;
}
- frame->size = size;
+ frame->length = length;
#endif
frame->priority = priority;