mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
nginx-0.0.12-2004-09-26-23:01:48 import
This commit is contained in:
@@ -1569,13 +1569,7 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r)
|
||||
|
||||
if (b != c->buffer) {
|
||||
|
||||
/*
|
||||
* If the large header buffers were allocated while the previous
|
||||
* request processing then we do not use c->buffer for
|
||||
* the pipelined request (see ngx_http_init_request()).
|
||||
*
|
||||
* Now we would move the large header buffers to the free list.
|
||||
*/
|
||||
/* move the large header buffers to the free list */
|
||||
|
||||
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
||||
|
||||
@@ -1627,15 +1621,6 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r)
|
||||
|
||||
hc->pipeline = 0;
|
||||
|
||||
|
||||
/*
|
||||
* To keep a memory footprint as small as possible for an idle
|
||||
* keepalive connection we try to free the ngx_http_request_t and
|
||||
* c->buffer's memory if they were allocated outside the c->pool.
|
||||
* The large header buffers are always allocated outside the c->pool and
|
||||
* are freed too.
|
||||
*/
|
||||
|
||||
if (ngx_pfree(c->pool, r) == NGX_OK) {
|
||||
hc->request = NULL;
|
||||
}
|
||||
@@ -1643,12 +1628,6 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r)
|
||||
b = c->buffer;
|
||||
|
||||
if (ngx_pfree(c->pool, b->start) == NGX_OK) {
|
||||
|
||||
/*
|
||||
* the special note for ngx_http_keepalive_handler() that
|
||||
* c->buffer's memory was freed
|
||||
*/
|
||||
|
||||
b->pos = NULL;
|
||||
|
||||
} else {
|
||||
@@ -1711,7 +1690,7 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r)
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* if ngx_http_request_t was freed then we need some other place */
|
||||
/* if "keepalive_buffers off" then we need some other place */
|
||||
r->http_state = NGX_HTTP_KEEPALIVE_STATE;
|
||||
#endif
|
||||
|
||||
@@ -1760,13 +1739,6 @@ static void ngx_http_keepalive_handler(ngx_event_t *rev)
|
||||
size = b->end - b->start;
|
||||
|
||||
if (b->pos == NULL) {
|
||||
|
||||
/*
|
||||
* The c->buffer's memory was freed by ngx_http_set_keepalive().
|
||||
* However, the c->buffer->start and c->buffer->end were not changed
|
||||
* to keep the buffer size.
|
||||
*/
|
||||
|
||||
if (!(b->pos = ngx_palloc(c->pool, size))) {
|
||||
ngx_http_close_connection(c);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user