Mercurial > hg > nginx
comparison src/http/ngx_http_upstream.c @ 3944:f1f194ceab16
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 11:24:16 +0000 |
parents | 22f3e9197096 |
children | 10fbb8f02a45 2d062c031fff |
comparison
equal
deleted
inserted
replaced
3943:bfab2536197b | 3944:f1f194ceab16 |
---|---|
659 | 659 |
660 /* TODO: add keys */ | 660 /* TODO: add keys */ |
661 | 661 |
662 ngx_http_file_cache_create_key(r); | 662 ngx_http_file_cache_create_key(r); |
663 | 663 |
664 if (r->cache->header_start >= u->conf->buffer_size) { | |
665 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | |
666 "cache key too large, increase upstream buffer size %uz", | |
667 u->conf->buffer_size); | |
668 | |
669 r->cache = NULL; | |
670 return NGX_DECLINED; | |
671 } | |
672 | |
664 switch (ngx_http_test_predicates(r, u->conf->cache_bypass)) { | 673 switch (ngx_http_test_predicates(r, u->conf->cache_bypass)) { |
665 | 674 |
666 case NGX_ERROR: | 675 case NGX_ERROR: |
667 return NGX_ERROR; | 676 return NGX_ERROR; |
668 | 677 |