nginx serving wrong website under proxy_cache

Igor Sysoev is at rambler-co.ru
Mon May 4 22:46:14 MSD 2009


On Sun, May 03, 2009 at 03:55:58PM -0400, Jim Ohlstein wrote:

> I reproduced the error:
> 
> 2009/05/03 15:34:05 [crit] 4845#0: *178 cache file 
> "/usr/local/nginx/cache/0/da/90e8de013d4126fbab247d12350fdda0" has md5 
> collision, client: 96.238.94.155, server: mydomain.com, request: "GET 
> /rtwhtrsyrn/010110A/687474702s7777772r777732746s7073697465732r636s6q2s627574746s6r2r7068703s753q776s726p6477617274776s7n6s6r655s636s6q 
> HTTP/1.1", host: "mydomain.com"

The attached patch should fix the bug.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/event/ngx_event_pipe.c
===================================================================
--- src/event/ngx_event_pipe.c	(revision 2115)
+++ src/event/ngx_event_pipe.c	(working copy)
@@ -397,7 +397,7 @@
 
         p->free_raw_bufs = p->free_raw_bufs->next;
 
-        if (p->free_bufs) {
+        if (p->free_bufs && p->buf_to_file == NULL) {
             for (cl = p->free_raw_bufs; cl; cl = cl->next) {
                 if (cl->buf->shadow == NULL) {
                     ngx_pfree(p->pool, cl->buf->start);


More information about the nginx mailing list