You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2010/11/22 20:32:26 UTC

svn commit: r1037849 - in /trafficserver/traffic/trunk: example/ example/cache_plugin/ example/file_system_cache/ iocore/cache/ proxy/ proxy/http2/

Author: jplevyak
Date: Mon Nov 22 19:32:25 2010
New Revision: 1037849

URL: http://svn.apache.org/viewvc?rev=1037849&view=rev
Log:
TS-551: remove NewCacheVC

Removed:
    trafficserver/traffic/trunk/example/cache_plugin/Makefile.am
    trafficserver/traffic/trunk/example/cache_plugin/cache_plugin.cc
    trafficserver/traffic/trunk/example/file_system_cache/DiskCache.cc
    trafficserver/traffic/trunk/example/file_system_cache/DiskCache.h
    trafficserver/traffic/trunk/example/file_system_cache/Makefile.am
    trafficserver/traffic/trunk/example/file_system_cache/diskcache_plugin.cc
    trafficserver/traffic/trunk/example/file_system_cache/test_diskcache.cc
    trafficserver/traffic/trunk/iocore/cache/NewCacheVC.cc
    trafficserver/traffic/trunk/iocore/cache/NewCacheVC.h
Modified:
    trafficserver/traffic/trunk/example/Makefile.am
    trafficserver/traffic/trunk/iocore/cache/Cache.cc
    trafficserver/traffic/trunk/iocore/cache/Makefile.am
    trafficserver/traffic/trunk/iocore/cache/P_Cache.h
    trafficserver/traffic/trunk/proxy/InkAPI.cc
    trafficserver/traffic/trunk/proxy/InkAPIInternal.h
    trafficserver/traffic/trunk/proxy/http2/HttpSM.cc
    trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
    trafficserver/traffic/trunk/proxy/http2/HttpTransact.h

Modified: trafficserver/traffic/trunk/example/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/example/Makefile.am?rev=1037849&r1=1037848&r2=1037849&view=diff
==============================================================================
--- trafficserver/traffic/trunk/example/Makefile.am (original)
+++ trafficserver/traffic/trunk/example/Makefile.am Mon Nov 22 19:32:25 2010
@@ -17,6 +17,5 @@
 if STANDALONE_IOCORE
 SUBDIRS = app-template
 else
-# TODO: add 'file_system_cache' example when working.
-SUBDIRS = . add-header append-transform basic-auth blacklist-0 blacklist-1 bnull-transform cache_plugin cache_scan file-1 gzip-transform hello null-transform output-header protocol query_remap redirect-1 remap replace-header response-header-1 server-transform session-1 thread-1 thread-pool
+SUBDIRS = . add-header append-transform basic-auth blacklist-0 blacklist-1 bnull-transform cache_scan file-1 gzip-transform hello null-transform output-header protocol query_remap redirect-1 remap replace-header response-header-1 server-transform session-1 thread-1 thread-pool
 endif

Modified: trafficserver/traffic/trunk/iocore/cache/Cache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Cache.cc?rev=1037849&r1=1037848&r2=1037849&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Cache.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/Cache.cc Mon Nov 22 19:32:25 2010
@@ -101,9 +101,6 @@ CacheProcessor cacheProcessor;
 Part **gpart = NULL;
 volatile int gnpart = 0;
 ClassAllocator<CacheVC> cacheVConnectionAllocator("cacheVConnection");
-#ifdef NON_MODULAR
-ClassAllocator<NewCacheVC> newCacheVConnectionAllocator("newCacheVConnection");
-#endif
 ClassAllocator<EvacuationBlock> evacuationBlockAllocator("evacuationBlock");
 ClassAllocator<CacheRemoveCont> cacheRemoveContAllocator("cacheRemoveCont");
 ClassAllocator<EvacuationKey> evacuationKeyAllocator("evacuationKey");
@@ -2751,37 +2748,6 @@ CacheProcessor::open_read(Continuation *
                               url, request, params, (CacheKey *) 0, pin_in_cache, type, (char *) 0, 0);
   }
 #endif
-  if (cache_global_hooks != NULL && cache_global_hooks->hooks_set > 0) {
-    Debug("cache_plugin", "[CacheProcessor::open_read] Cache hooks are set");
-    APIHook *cache_lookup = cache_global_hooks->get(TS_CACHE_PLUGIN_HOOK);
-
-    if (cache_lookup != NULL) {
-      HttpCacheSM *sm = (HttpCacheSM *) cont;
-      if (sm != NULL) {
-        if (sm->master_sm && sm->master_sm->t_state.cache_vc) {
-          Debug("cache_plugin", "[CacheProcessor::open_read] Freeing existing cache_vc");
-          sm->master_sm->t_state.cache_vc->free();
-          sm->master_sm->t_state.cache_vc = NULL;
-        }
-        NewCacheVC *vc = NewCacheVC::alloc(cont, url, sm);
-        vc->setConfigParams(params);
-        vc->set_cache_http_hdr(request);
-        if (sm->master_sm) {
-          sm->master_sm->t_state.cache_vc = vc;
-        }
-        //vc->setCtrlInPlugin(true);
-        int rval = cache_lookup->invoke(TS_EVENT_CACHE_LOOKUP, (void *) vc);
-        if (rval == TS_SUCCESS) {
-          return ACTION_RESULT_DONE;
-        } else {
-          abort();
-        }
-      } else {
-        Error("[CacheProcessor::open_read] cache sm is NULL");
-      }
-    }
-  }
-
   return caches[type]->open_read(cont, url, request, params, type);
 }
 
@@ -2808,26 +2774,6 @@ CacheProcessor::open_write(Continuation 
     }
   }
 #endif
-  // cache plugin
-  if (cache_global_hooks != NULL && cache_global_hooks->hooks_set > 0) {
-    Debug("cache_plugin", "[CacheProcessor::open_write] Cache hooks are set, old_info=%p", old_info);
-
-    HttpCacheSM *sm = (HttpCacheSM *) cont;
-    if (sm->master_sm && sm->master_sm->t_state.cache_vc) {
-      // use NewCacheVC from lookup
-      NewCacheVC *vc = sm->master_sm->t_state.cache_vc;
-      vc->setWriteVC(old_info);
-      //vc->setCtrlInPlugin(true);
-      // since we are reusing the read vc, set it to NULL to prevent double io_close
-      sm->cache_read_vc = NULL;
-      sm->handleEvent(CACHE_EVENT_OPEN_WRITE, (void *) vc);
-      return ACTION_RESULT_DONE;
-    } else {
-      DDebug("cache_plugin", "[CacheProcessor::open_write] Error: NewCacheVC not set");
-      sm->handleEvent(CACHE_EVENT_OPEN_WRITE_FAILED, (void *) -ECACHE_WRITE_FAIL);
-      return ACTION_RESULT_DONE;
-    }
-  }
   return caches[type]->open_write(cont, url, request, old_info, pin_in_cache, type);
 }
 
@@ -2839,22 +2785,6 @@ CacheProcessor::remove(Continuation *con
   if (cache_clustering_enabled > 0) {
   }
 #endif
-  if (cache_global_hooks != NULL && cache_global_hooks->hooks_set > 0) {
-    DDebug("cache_plugin", "[CacheProcessor::remove] Cache hooks are set");
-    APIHook *cache_lookup = cache_global_hooks->get(TS_CACHE_PLUGIN_HOOK);
-    if (cache_lookup != NULL) {
-      NewCacheVC *vc = NewCacheVC::alloc(cont, url, NULL);
-      int rval = cache_lookup->invoke(TS_EVENT_CACHE_DELETE, (void *) vc);
-      if (vc) {
-        vc->free();
-      }
-      if (rval == TS_SUCCESS) {
-        return ACTION_RESULT_DONE;
-      } else {
-        abort();
-      }
-    }
-  }
   return caches[frag_type]->remove(cont, url, frag_type);
 }
 

Modified: trafficserver/traffic/trunk/iocore/cache/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Makefile.am?rev=1037849&r1=1037848&r2=1037849&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Makefile.am (original)
+++ trafficserver/traffic/trunk/iocore/cache/Makefile.am Mon Nov 22 19:32:25 2010
@@ -36,8 +36,7 @@ AM_CPPFLAGS = \
   -I$(top_srcdir)/proxy/mgmt2/utils \
   -DSYSCONFDIR=\"$(sysconfdir)\"
 
-ADD_SRC = NewCacheVC.cc NewCacheVC.h
-
+ADD_SRC =
 if BUILD_TESTS
   ADD_SRC += CacheTest.cc P_CacheTest.h 
 endif

Modified: trafficserver/traffic/trunk/iocore/cache/P_Cache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_Cache.h?rev=1037849&r1=1037848&r2=1037849&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_Cache.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_Cache.h Mon Nov 22 19:32:25 2010
@@ -50,7 +50,4 @@
 #include "P_CacheInternal.h"
 #include "P_CacheHosting.h"
 #include "P_CacheHttp.h"
-#ifdef HTTP_CACHE
-#include "NewCacheVC.h"
-#endif
 #endif /* _P_CACHE_H */

Modified: trafficserver/traffic/trunk/proxy/InkAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPI.cc?rev=1037849&r1=1037848&r2=1037849&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/InkAPI.cc Mon Nov 22 19:32:25 2010
@@ -348,7 +348,6 @@ tsapi int TS_HTTP_LEN_TRACE;
 tsapi const TSMLoc TS_NULL_MLOC = (TSMLoc)NULL;
 
 HttpAPIHooks *http_global_hooks = NULL;
-CacheAPIHooks *cache_global_hooks = NULL;
 ConfigUpdateCbTable *global_config_cbs = NULL;
 
 static char traffic_server_version[128] = "";
@@ -1390,57 +1389,6 @@ HttpAPIHooks::get(TSHttpHookID id)
 }
 
 
-//Cache API
-
-CacheAPIHooks::CacheAPIHooks():
-hooks_set(0)
-{
-}
-
-CacheAPIHooks::~CacheAPIHooks()
-{
-  clear();
-}
-
-void
-CacheAPIHooks::clear()
-{
-  APIHook *api_hook;
-  APIHook *next_hook;
-  int i;
-
-  for (i = 0; i < TS_CACHE_LAST_HOOK; i++) {
-    api_hook = m_hooks[i].get();
-    while (api_hook) {
-      next_hook = api_hook->m_link.next;
-      apiHookAllocator.free(api_hook);
-      api_hook = next_hook;
-    }
-  }
-  hooks_set = 0;
-}
-
-void
-CacheAPIHooks::append(TSCacheHookID id, INKContInternal *cont)
-{
-  hooks_set = 1;
-  m_hooks[id].append(cont);
-}
-
-APIHook *
-CacheAPIHooks::get(TSCacheHookID id)
-{
-  return m_hooks[id].get();
-}
-
-void
-CacheAPIHooks::prepend(TSCacheHookID id, INKContInternal *cont)
-{
-  hooks_set = 1;
-  m_hooks[id].prepend(cont);
-}
-
-
 ////////////////////////////////////////////////////////////////////
 //
 // ConfigUpdateCbTable
@@ -1772,7 +1720,6 @@ api_init()
     TS_HTTP_LEN_S_MAXAGE = HTTP_LEN_S_MAXAGE;
 
     http_global_hooks = NEW(new HttpAPIHooks);
-    cache_global_hooks = NEW(new CacheAPIHooks);
     global_config_cbs = NEW(new ConfigUpdateCbTable);
 
     if (TS_MAX_API_STATS > 0) {
@@ -4038,31 +3985,6 @@ sdk_sanity_check_cachekey(TSCacheKey key
 }
 
 TSReturnCode
-TSCacheKeyGet(TSCacheTxn txnp, void **key, int *length)
-{
-  NewCacheVC *vc = (NewCacheVC *) txnp;
-
-  Debug("cache_plugin", "[TSCacheKeyGet] vc get cache key");
-  //    *key = (void*) NEW(new TS_MD5);
-
-  // just pass back the url and don't do the md5
-  vc->getCacheKey(key, length);
-
-  return TS_SUCCESS;
-}
-
-TSReturnCode
-TSCacheHeaderKeyGet(TSCacheTxn txnp, void **key, int *length)
-{
-  NewCacheVC *vc = (NewCacheVC *) txnp;
-
-  Debug("cache_plugin", "[TSCacheKeyGet] vc get cache header key");
-  vc->getCacheHeaderKey(key, length);
-
-  return TS_SUCCESS;
-}
-
-TSReturnCode
 TSCacheKeyCreate(TSCacheKey *new_key)
 {
 #ifdef DEBUG
@@ -4469,18 +4391,6 @@ TSHttpHookAdd(TSHttpHookID id, TSCont co
   return TS_ERROR;
 }
 
-/* Cache hooks */
-
-TSReturnCode
-TSCacheHookAdd(TSCacheHookID id, TSCont contp)
-{
-  if (sdk_sanity_check_continuation(contp) == TS_SUCCESS) {
-    cache_global_hooks->append(id, (INKContInternal *) contp);
-    return TS_SUCCESS;
-  }
-  return TS_ERROR;
-}
-
 void
 TSHttpIcpDynamicSet(int value)
 {
@@ -5480,142 +5390,6 @@ private:
 
 
 //----------------------------------------------------------------------------
-TSIOBufferReader
-TSCacheBufferReaderGet(TSCacheTxn txnp)
-{
-  NewCacheVC *vc = (NewCacheVC *) txnp;
-
-  return vc->getBufferReader();
-}
-
-
-//----------------------------------------------------------------------------
-//TSReturnCode
-//TSCacheBufferInfoGet(TSHttpTxn txnp, void **buffer, uint64 *length, uint64 *offset)
-TSReturnCode
-TSCacheBufferInfoGet(TSCacheTxn txnp, uint64 *length, uint64 *offset)
-{
-  NewCacheVC *vc = (NewCacheVC *) txnp;
-
-  vc->getCacheBufferInfo(length, offset);
-  return TS_SUCCESS;
-}
-
-
-
-//----------------------------------------------------------------------------
-TSReturnCode
-TSHttpCacheReenable(TSCacheTxn txnp, const TSEvent event, const void *data, const uint64 size)
-{
-  Debug("cache_plugin", "[TSHttpCacheReenable] event id: %d data: %lX size: %llu", event, (unsigned long) data, size);
-  //bool calledUser = 0;
-  NewCacheVC *vc = (NewCacheVC *) txnp;
-  if (vc->isClosed()) {
-    return TS_SUCCESS;
-  }
-  //vc->setCtrlInPlugin(false);
-  switch (event) {
-
-  case TS_EVENT_CACHE_READ_READY:
-  case TS_EVENT_CACHE_READ_COMPLETE:  // read
-    Debug("cache_plugin", "[TSHttpCacheReenable] cache_read");
-    if (data != 0) {
-
-      // set CacheHTTPInfo in the VC
-      //vc->setCacheHttpInfo(data, size);
-
-      //vc->getTunnel()->append_message_to_producer_buffer(vc->getTunnel()->get_producer(vc),(const char*)data,size);
-      //           HTTPInfo *cacheInfo;
-      //            vc->get_http_info(&cacheInfo);
-      //unsigned int doc_size = cacheInfo->object_size_get();
-      bool retVal = vc->setRangeAndSize(size);
-      //TSMutexLock(vc->getTunnel()->mutex);
-      vc->getTunnel()->get_producer(vc)->read_buffer->write((const char *) data, size);
-      if (retVal) {
-        vc->getTunnel()->get_producer(vc)->read_buffer->write("\r\n", 2);
-        vc->add_boundary(true);
-      }
-      Debug("cache_plugin", "[TSHttpCacheReenable] cache_read ntodo %d", vc->getVio()->ntodo());
-      if (vc->getVio()->ntodo() > 0)
-        vc->getTunnel()->handleEvent(VC_EVENT_READ_READY, vc->getVio());
-      else
-        vc->getTunnel()->handleEvent(VC_EVENT_READ_COMPLETE, vc->getVio());
-      //TSMutexUnlock(vc->getTunnel()->mutex);
-    } else {
-      // not in cache
-      //TSMutexLock(vc->getTunnel()->mutex);
-      vc->getTunnel()->handleEvent(VC_EVENT_ERROR, vc->getVio());
-      //TSMutexUnlock(vc->getTunnel()->mutex);
-    }
-
-    break;
-  case TS_EVENT_CACHE_LOOKUP_COMPLETE:
-    Debug("cache_plugin", "[TSHttpCacheReenable] cache_lookup_complete");
-    if (data == 0 || !vc->completeCacheHttpInfo(data, size)) {
-      Debug("cache_plugin", "[TSHttpCacheReenable] open read failed");
-      //TSMutexLock(vc->getCacheSm()->mutex);
-      vc->getCacheSm()->handleEvent(CACHE_EVENT_OPEN_READ_FAILED, (void *) -ECACHE_NO_DOC);
-      //TSMutexUnlock(vc->getCacheSm()->mutex);
-      break;
-    }
-    Debug("cache_plugin", "[TSHttpCacheReenable] we have data");
-    //TSMutexLock(vc->getCacheSm()->mutex);
-    vc->getCacheSm()->handleEvent(CACHE_EVENT_OPEN_READ, (void *) vc);
-    //TSMutexUnlock(vc->getCacheSm()->mutex);
-    break;
-  case TS_EVENT_CACHE_LOOKUP_READY:
-    Debug("cache_plugin", "[TSHttpCacheReenable] cache_lookup_ready");
-    if (data == 0 || !vc->appendCacheHttpInfo(data, size)) {
-      Debug("cache_plugin", "[TSHttpCacheReenable] open read failed");
-      // not in cache, free the vc
-      //TSMutexLock(vc->getCacheSm()->mutex);
-      vc->getCacheSm()->handleEvent(CACHE_EVENT_OPEN_READ_FAILED, (void *) -ECACHE_NO_DOC);
-      //TSMutexUnlock(vc->getCacheSm()->mutex);
-    }
-    break;
-  case TS_EVENT_CACHE_WRITE:  // write
-  case TS_EVENT_CACHE_WRITE_HEADER:
-    {
-      Debug("cache_plugin", "[TSHttpCacheReenable] cache_write");
-      if (vc->getState() == NewCacheVC::NEW_CACHE_WRITE_HEADER && vc->getVio()->ntodo() <= 0) {
-        //vc->getCacheSm()->handleEvent(VC_EVENT_WRITE_COMPLETE, vc->getVio());
-        Debug("cache_plugin", "[TSHttpCacheReenable] NewCacheVC::NEW_CACHE_WRITE_HEADER");
-        // writing header
-        // do nothing
-      } else {
-        vc->setTotalObjectSize(size);
-        vc->getVio()->ndone = size;
-        if (vc->getVio()->ntodo() <= 0) {
-          //TSMutexLock(vc->getCacheSm()->mutex);
-          vc->getTunnel()->handleEvent(VC_EVENT_WRITE_COMPLETE, vc->getVio());
-          //TSMutexUnlock(vc->getCacheSm()->mutex);
-        } else {
-          //TSMutexLock(vc->getCacheSm()->mutex);
-          vc->getTunnel()->handleEvent(VC_EVENT_WRITE_READY, vc->getVio());
-          //TSMutexUnlock(vc->getCacheSm()->mutex);
-        }
-      }
-    }
-    break;
-
-  case TS_EVENT_CACHE_DELETE:
-    break;
-
-    // handle read_ready, read_complete, write_ready, write_complete
-    // read_failure, write_failure
-  case TS_EVENT_CACHE_CLOSE:
-    //do nothing
-    break;
-
-  default:
-    break;
-  }
-
-  return TS_SUCCESS;
-}
-
-
-//----------------------------------------------------------------------------
 TSReturnCode
 TSHttpTxnReenable(TSHttpTxn txnp, TSEvent event)
 {
@@ -7436,15 +7210,6 @@ TSCacheUrlSet(TSHttpTxn txnp, const char
   return TS_SUCCESS;
 }
 
-TSHttpTxn
-TSCacheGetStateMachine(TSCacheTxn txnp)
-{
-  NewCacheVC *vc = (NewCacheVC *) txnp;
-  HttpCacheSM *cacheSm = (HttpCacheSM *) vc->getCacheSm();
-
-  return cacheSm->master_sm;
-}
-
 void
 TSCacheHttpInfoKeySet(TSCacheHttpInfo infop, TSCacheKey keyp)
 {

Modified: trafficserver/traffic/trunk/proxy/InkAPIInternal.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/InkAPIInternal.h?rev=1037849&r1=1037848&r2=1037849&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/InkAPIInternal.h (original)
+++ trafficserver/traffic/trunk/proxy/InkAPIInternal.h Mon Nov 22 19:32:25 2010
@@ -35,9 +35,6 @@
 #include "List.h"
 #include "ProxyConfig.h"
 #include "P_Cache.h"
-class CacheAPIHooks;
-extern CacheAPIHooks *cache_global_hooks;
-
 
 
 /* ****** Cache Structure ********* */
@@ -160,26 +157,6 @@ private:
 };
 
 
-class CacheAPIHooks
-{
-public:
-  CacheAPIHooks();
-  ~CacheAPIHooks();
-
-  void clear();
-  void prepend(TSCacheHookID id, INKContInternal * cont);
-  void append(TSCacheHookID id, INKContInternal * cont);
-  APIHook *get(TSCacheHookID id);
-
-  // A boolean value to quickly see if
-  //   any hooks are set
-  int hooks_set;
-
-private:
-    APIHooks m_hooks[TS_HTTP_LAST_HOOK];
-};
-
-
 class ConfigUpdateCallback:public Continuation
 {
 public:

Modified: trafficserver/traffic/trunk/proxy/http2/HttpSM.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpSM.cc?rev=1037849&r1=1037848&r2=1037849&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpSM.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpSM.cc Mon Nov 22 19:32:25 2010
@@ -4028,13 +4028,8 @@ HttpSM::do_cache_delete_all_alts(Continu
 
   Action *cache_action_handle = NULL;
 
-  if (!cont && cache_global_hooks->get(TS_CACHE_PLUGIN_HOOK)) {
-    // cache plugin, must pass a continuation
-    cacheProcessor.remove(&cache_sm, t_state.cache_info.lookup_url);
-  } else {
-    cache_action_handle = cacheProcessor.remove(cont,   // continuation
-                                                t_state.cache_info.lookup_url); // url
-  }
+  cache_action_handle = cacheProcessor.remove(cont,   // continuation
+                                              t_state.cache_info.lookup_url); // url
 
   if (cont != NULL) {
     if (cache_action_handle != ACTION_RESULT_DONE) {

Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc?rev=1037849&r1=1037848&r2=1037849&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc Mon Nov 22 19:32:25 2010
@@ -2833,8 +2833,7 @@ HttpTransact::build_response_from_cache(
       // Check if cached response supports Range. If it does, append
       // Range transformation plugin
       // only if the cached response is a 200 OK
-      if (client_response_code == HTTP_STATUS_OK && client_request->presence(MIME_PRESENCE_RANGE) &&
-          (cache_global_hooks == NULL || cache_global_hooks->hooks_set <= 0)) {
+      if (client_response_code == HTTP_STATUS_OK && client_request->presence(MIME_PRESENCE_RANGE)) {
         s->state_machine->do_range_setup_if_necessary();
         if (s->range_setup == RANGE_NOT_SATISFIABLE &&
             s->http_config_param->reverse_proxy_enabled) {

Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransact.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransact.h?rev=1037849&r1=1037848&r2=1037849&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransact.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransact.h Mon Nov 22 19:32:25 2010
@@ -906,7 +906,6 @@ public:
     HttpTransactMagic_t m_magic;
 
     HttpSM *state_machine;
-    NewCacheVC *cache_vc;
 
     Arena arena;
 
@@ -1069,7 +1068,7 @@ public:
 
     // Constructor
     State()
-      : m_magic(HTTP_TRANSACT_MAGIC_ALIVE), state_machine(NULL), cache_vc(NULL), http_config_param(NULL), force_dns(false),
+      : m_magic(HTTP_TRANSACT_MAGIC_ALIVE), state_machine(NULL), http_config_param(NULL), force_dns(false),
         updated_server_version(HostDBApplicationInfo::HTTP_VERSION_UNDEFINED), is_revalidation_necessary(false),
         HashTable_Tries(0),             //YTS Team, yamsat
         request_will_not_selfloop(false),       //YTS Team, yamsat
@@ -1204,11 +1203,6 @@ public:
       record_transaction_stats();
       m_magic = HTTP_TRANSACT_MAGIC_DEAD;
 
-      if (cache_vc) {
-        cache_vc->free();
-        cache_vc = NULL;
-      }
-
       if (internal_msg_buffer) {
         free_internal_msg_buffer(internal_msg_buffer, internal_msg_buffer_fast_allocator_size);
       }