Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 4907:01d3d3a185e9 stable-1.2
Merge of r4892: keepalive memory usage optimization.
The ngx_http_keepalive_handler() function is now trying to not
keep c->buffer's memory for idle connections.
This behaviour is consistent with the ngx_http_set_keepalive()
function and it should decrease memory usage in some cases (especially
if epoll/rtsig is used).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 13 Nov 2012 11:21:31 +0000 |
parents | c3b276283e4a |
children | 7f141f99f1cd |
comparison
equal
deleted
inserted
replaced
4906:bc92e877d36d | 4907:01d3d3a185e9 |
---|---|
2743 if (n == NGX_AGAIN) { | 2743 if (n == NGX_AGAIN) { |
2744 if (ngx_handle_read_event(rev, 0) != NGX_OK) { | 2744 if (ngx_handle_read_event(rev, 0) != NGX_OK) { |
2745 ngx_http_close_connection(c); | 2745 ngx_http_close_connection(c); |
2746 } | 2746 } |
2747 | 2747 |
2748 /* | |
2749 * Like ngx_http_set_keepalive() we are trying to not hold | |
2750 * c->buffer's memory for a keepalive connection. | |
2751 */ | |
2752 | |
2753 if (ngx_pfree(c->pool, b->start) == NGX_OK) { | |
2754 | |
2755 /* | |
2756 * the special note that c->buffer's memory was freed | |
2757 */ | |
2758 | |
2759 b->pos = NULL; | |
2760 } | |
2761 | |
2748 return; | 2762 return; |
2749 } | 2763 } |
2750 | 2764 |
2751 if (n == NGX_ERROR) { | 2765 if (n == NGX_ERROR) { |
2752 ngx_http_close_connection(c); | 2766 ngx_http_close_connection(c); |