Public bug reported:

Binary package hint: squid

As described at : 
http://wiki.squid-cache.org/ConfigExamples/DynamicContent/YouTube/Discussion 
there is a bug with http 302 response moved_temporarily when using storeurl.
The storeurl stores the 302 instead of following the redirect and then a loop 
occurs. 

The fix to ignore small sized object : minimum_object_size 512 bytes is
not always working, just burnt myself with 302 bigger than 512 bytes
from youtube.

The patch described works perfectly on squid_2.7.STABLE7-1ubuntu1 from
lucid. Both Lucid and Karmic are affected by this bug.

The patch is small :
--- src/client_side.c   2008-10-30 07:37:56 +0800
+++ src/client_side.c   2008-11-05 23:44:55 +0800
@@ -2399,6 +2399,18 @@
                is_modified = 0;
        }
     }
+       /* bug fix for 302 moved_temporarily loop bug when using storeurl*/
+       if (mem->reply->sline.status == HTTP_MOVED_TEMPORARILY) {
+       const char *cloc = httpHeaderGetStr(&e->mem_obj->reply->header, 
HDR_LOCATION);
+       if (!strcmp(http->uri,cloc)) {
+           debug(33, 1) ("Loop Detected: %s Redirect to: %s\n",
+               http->uri,cloc);
+           http->log_type = LOG_TCP_MISS;
+           clientProcessMiss(http);
+               return;
+       } 
+       }
+       /* bug fix end here*/
     stale = refreshCheckHTTPStale(e, r);
     debug(33, 2) ("clientCacheHit: refreshCheckHTTPStale returned %d\n", 
stale);
     if (stale == 0) {

It was not integrated upstream even in the last head branch. Hope to
have it included in Ubuntu LTS.

** Affects: squid (Ubuntu)
     Importance: Undecided
         Status: New

-- 
Loop with moved_temporarily and when using storeurl
https://bugs.launchpad.net/bugs/503777
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to squid in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to