aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2014-01-15 17:16:38 +0400
committerValentin Bartenev <vbart@nginx.com>2014-01-15 17:16:38 +0400
commit82a1ff31f9ff38ef2fabdff7857fe0fc974e8a8b (patch)
treeb8528732bb4a4b3b90248b49016c2072eb77e7ac /src
parentb2b43ca50f0bfdf31a600f61db28155f13382b22 (diff)
downloadnginx-82a1ff31f9ff38ef2fabdff7857fe0fc974e8a8b.tar.gz
nginx-82a1ff31f9ff38ef2fabdff7857fe0fc974e8a8b.zip
SPDY: the SETTINGS frame should be allocated from sc->pool.
There is no reason to allocate it from connection pool that more like just a bug especially since ngx_http_spdy_settings_frame_handler() already uses sc->pool to free a chain.
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_spdy.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/http/ngx_http_spdy.c b/src/http/ngx_http_spdy.c
index 01b8e284e..46467ac4d 100644
--- a/src/http/ngx_http_spdy.c
+++ b/src/http/ngx_http_spdy.c
@@ -1598,7 +1598,6 @@ ngx_http_spdy_send_settings(ngx_http_spdy_connection_t *sc)
{
u_char *p;
ngx_buf_t *buf;
- ngx_pool_t *pool;
ngx_chain_t *cl;
ngx_http_spdy_srv_conf_t *sscf;
ngx_http_spdy_out_frame_t *frame;
@@ -1606,21 +1605,19 @@ ngx_http_spdy_send_settings(ngx_http_spdy_connection_t *sc)
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
"spdy create SETTINGS frame");
- pool = sc->connection->pool;
-
- frame = ngx_palloc(pool, sizeof(ngx_http_spdy_out_frame_t));
+ frame = ngx_palloc(sc->pool, sizeof(ngx_http_spdy_out_frame_t));
if (frame == NULL) {
return NGX_ERROR;
}
- cl = ngx_alloc_chain_link(pool);
+ cl = ngx_alloc_chain_link(sc->pool);
if (cl == NULL) {
return NGX_ERROR;
}
- buf = ngx_create_temp_buf(pool, NGX_SPDY_FRAME_HEADER_SIZE
- + NGX_SPDY_SETTINGS_NUM_SIZE
- + NGX_SPDY_SETTINGS_PAIR_SIZE);
+ buf = ngx_create_temp_buf(sc->pool, NGX_SPDY_FRAME_HEADER_SIZE
+ + NGX_SPDY_SETTINGS_NUM_SIZE
+ + NGX_SPDY_SETTINGS_PAIR_SIZE);
if (buf == NULL) {
return NGX_ERROR;
}