Welcome! Log In Create A New Profile

Advanced

[nginx] SPDY: the SETTINGS frame should be allocated from sc->pool.

Valentin Bartenev
January 15, 2014 12:36PM
details: http://hg.nginx.org/nginx/rev/22c249dac7c1
branches:
changeset: 5519:22c249dac7c1
user: Valentin Bartenev <vbart@nginx.com>
date: Wed Jan 15 17:16:38 2014 +0400
description:
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:

src/http/ngx_http_spdy.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)

diffs (38 lines):

diff -r ec9e9da4c1fb -r 22c249dac7c1 src/http/ngx_http_spdy.c
--- a/src/http/ngx_http_spdy.c Wed Jan 15 17:16:38 2014 +0400
+++ b/src/http/ngx_http_spdy.c Wed Jan 15 17:16:38 2014 +0400
@@ -1598,7 +1598,6 @@ ngx_http_spdy_send_settings(ngx_http_spd
{
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_spd
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;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] SPDY: the SETTINGS frame should be allocated from sc->pool.

Valentin Bartenev 611 January 15, 2014 12:36PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 290
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready