Loop with moved_temporarily and when using storeurl

Bug #503777 reported by frenet on 2010-01-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
squid (Ubuntu)
Nominated for Lucid by frenet

Bug Description

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.

Chuck Short (zulcss) on 2010-01-09
Changed in squid (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
frenet (renet-f) wrote :

I disagree with the importance assigned to this bug. Working with a small rural ISP in northern India, youtube is more than 25% of our bandwidth and content delivery network (hi5, facebook, yimg....) are another 10%. Without the ability of using storeurl it means that more than one third of the traffic is not cacheable.
I'd like to see this bug raised to critic and that's why I nominate it for release.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package squid - 2.7.STABLE7-1ubuntu2

squid (2.7.STABLE7-1ubuntu2) lucid; urgency=low

  [Michael Vogt]
  * debian/patches/90-cf.data.ubuntu.dpatch:
    - add an example refresh pattern for debs
      (foundations-lucid-local-report spec)

  [Chuck Short]
  * Dont bring down the buildd because the number of jobs
    is set wrong. (LP: #476953)
  * debian/patches/99-fix-storeurl-move-temp.dpatch:
    - Fix bug with http 302 response moved temporarily. (LP: #503777)
  * debian/squid.upstart, debian/rules: Convert initscripts to upstart.
  * debian/squid-capability.dpatch: Fix libcap compatibility issues.
 -- Chuck Short <email address hidden> Fri, 22 Jan 2010 14:45:45 -0500

Changed in squid (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers