comparison src/http/ngx_http_upstream.c @ 3953:7c1c25082865 stable-0.7

merge r3945: fix segfault if cache key is larger than upstream buffer size patch by Lanshun Zhou
author Igor Sysoev <igor@sysoev.ru>
date Tue, 19 Jul 2011 14:15:50 +0000
parents 8152369f7037
children
comparison
equal deleted inserted replaced
3952:4d61547bbc2a 3953:7c1c25082865
618 618
619 /* TODO: add keys */ 619 /* TODO: add keys */
620 620
621 ngx_http_file_cache_create_key(r); 621 ngx_http_file_cache_create_key(r);
622 622
623 if (c->header_start >= u->conf->buffer_size) {
624 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
625 "cache key too large, increase upstream buffer size %uz",
626 u->conf->buffer_size);
627
628 r->cache = NULL;
629 return NGX_DECLINED;
630 }
631
623 u->cacheable = 1; 632 u->cacheable = 1;
624 633
625 c->min_uses = u->conf->cache_min_uses; 634 c->min_uses = u->conf->cache_min_uses;
626 c->body_start = u->conf->buffer_size; 635 c->body_start = u->conf->buffer_size;
627 c->file_cache = u->conf->cache->data; 636 c->file_cache = u->conf->cache->data;