You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2011/05/18 06:06:08 UTC

svn commit: r1104684 - in /trafficserver/traffic/trunk/proxy/http: HttpTransactCache.cc HttpTransactCache.h

Author: zwoop
Date: Wed May 18 04:06:08 2011
New Revision: 1104684

URL: http://svn.apache.org/viewvc?rev=1104684&view=rev
Log:
TS-789 PURGE should purge all alternates, no matter what the request headers indicate

Modified:
    trafficserver/traffic/trunk/proxy/http/HttpTransactCache.cc
    trafficserver/traffic/trunk/proxy/http/HttpTransactCache.h

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransactCache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransactCache.cc?rev=1104684&r1=1104683&r2=1104684&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransactCache.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransactCache.cc Wed May 18 04:06:08 2011
@@ -313,10 +313,14 @@ HttpTransactCache::calculate_quality_of_
   MIMEField *cached_accept_field;
   MIMEField *content_field;
 
+  // For PURGE requests, any alternate is good really.
+  if (client_request->method_get_wksidx() == HTTP_WKSIDX_PURGE)
+    return (float)1.0;
+
   // BZ49848 - for cached negative respones, we don't check for the
   // Accept* headers. This should also be good for the 301 response.
   if (obj_origin_server_response->status_get() != HTTP_STATUS_OK)
-    return (float) 1.0;
+    return (float)1.0;
 
   q[1] = (q[2] = (q[3] = -2.0));        /* just to make debug output happy :) */
 

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransactCache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransactCache.h?rev=1104684&r1=1104683&r2=1104684&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransactCache.h (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransactCache.h Wed May 18 04:06:08 2011
@@ -52,17 +52,18 @@ public:
   inkcoreapi int marshal(char *buf, int length);
   int unmarshal(Arena * arena, const char *buf, int length);
 
-    CacheLookupHttpConfig():cache_global_user_agent_header(false),
+  CacheLookupHttpConfig():
+    cache_global_user_agent_header(false),
     cache_enable_default_vary_headers(false),
     ignore_accept_mismatch(false),
     ignore_accept_language_mismatch(false),
     ignore_accept_encoding_mismatch(false),
     ignore_accept_charset_mismatch(false),
     cache_vary_default_text(NULL), cache_vary_default_images(NULL), cache_vary_default_other(NULL)
-  {
-  }
-  void *operator  new(size_t size, void *mem);
-  void operator  delete(void *mem);
+  { }
+
+  void *operator new(size_t size, void *mem);
+  void operator delete(void *mem);
 };
 
 extern ClassAllocator<CacheLookupHttpConfig> CacheLookupHttpConfigAllocator;
@@ -70,16 +71,14 @@ extern ClassAllocator<CacheLookupHttpCon
 extern CacheLookupHttpConfig global_cache_lookup_config;
 
 inline void *
-  CacheLookupHttpConfig::operator
-new(size_t size, void *mem)
+CacheLookupHttpConfig::operator new(size_t size, void *mem)
 {
   (void) size;
   return mem;
 }
 
 inline void
-  CacheLookupHttpConfig::operator
-delete(void *mem)
+CacheLookupHttpConfig::operator delete(void *mem)
 {
   CacheLookupHttpConfigAllocator.free((CacheLookupHttpConfig *) mem);
 }