Mercurial > hg > nginx
comparison src/http/ngx_http_spdy.c @ 5519:22c249dac7c1
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.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Wed, 15 Jan 2014 17:16:38 +0400 |
parents | ec9e9da4c1fb |
children | a336cbc3dd44 |
comparison
equal
deleted
inserted
replaced
5518:ec9e9da4c1fb | 5519:22c249dac7c1 |
---|---|
1596 static ngx_int_t | 1596 static ngx_int_t |
1597 ngx_http_spdy_send_settings(ngx_http_spdy_connection_t *sc) | 1597 ngx_http_spdy_send_settings(ngx_http_spdy_connection_t *sc) |
1598 { | 1598 { |
1599 u_char *p; | 1599 u_char *p; |
1600 ngx_buf_t *buf; | 1600 ngx_buf_t *buf; |
1601 ngx_pool_t *pool; | |
1602 ngx_chain_t *cl; | 1601 ngx_chain_t *cl; |
1603 ngx_http_spdy_srv_conf_t *sscf; | 1602 ngx_http_spdy_srv_conf_t *sscf; |
1604 ngx_http_spdy_out_frame_t *frame; | 1603 ngx_http_spdy_out_frame_t *frame; |
1605 | 1604 |
1606 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0, | 1605 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0, |
1607 "spdy create SETTINGS frame"); | 1606 "spdy create SETTINGS frame"); |
1608 | 1607 |
1609 pool = sc->connection->pool; | 1608 frame = ngx_palloc(sc->pool, sizeof(ngx_http_spdy_out_frame_t)); |
1610 | |
1611 frame = ngx_palloc(pool, sizeof(ngx_http_spdy_out_frame_t)); | |
1612 if (frame == NULL) { | 1609 if (frame == NULL) { |
1613 return NGX_ERROR; | 1610 return NGX_ERROR; |
1614 } | 1611 } |
1615 | 1612 |
1616 cl = ngx_alloc_chain_link(pool); | 1613 cl = ngx_alloc_chain_link(sc->pool); |
1617 if (cl == NULL) { | 1614 if (cl == NULL) { |
1618 return NGX_ERROR; | 1615 return NGX_ERROR; |
1619 } | 1616 } |
1620 | 1617 |
1621 buf = ngx_create_temp_buf(pool, NGX_SPDY_FRAME_HEADER_SIZE | 1618 buf = ngx_create_temp_buf(sc->pool, NGX_SPDY_FRAME_HEADER_SIZE |
1622 + NGX_SPDY_SETTINGS_NUM_SIZE | 1619 + NGX_SPDY_SETTINGS_NUM_SIZE |
1623 + NGX_SPDY_SETTINGS_PAIR_SIZE); | 1620 + NGX_SPDY_SETTINGS_PAIR_SIZE); |
1624 if (buf == NULL) { | 1621 if (buf == NULL) { |
1625 return NGX_ERROR; | 1622 return NGX_ERROR; |
1626 } | 1623 } |
1627 | 1624 |
1628 buf->last_buf = 1; | 1625 buf->last_buf = 1; |