trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [trafficserver] 15/33: TS-4425: Switch P_CacheInternal.h over to Ptr::get().
Date Wed, 11 May 2016 20:31:39 GMT
This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 90859130376d3069d684e9311e54036ffe1a5093
Author: James Peach <jpeach@apache.org>
AuthorDate: Thu May 5 21:04:51 2016 -0700

    TS-4425: Switch P_CacheInternal.h over to Ptr::get().
---
 iocore/cache/P_CacheInternal.h | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/iocore/cache/P_CacheInternal.h b/iocore/cache/P_CacheInternal.h
index 8db829b..7fd3162 100644
--- a/iocore/cache/P_CacheInternal.h
+++ b/iocore/cache/P_CacheInternal.h
@@ -234,17 +234,20 @@ struct CacheVC : public CacheVConnection {
     ink_assert(vio.op == VIO::READ);
     return !f.not_from_ram_cache;
   }
+
   int
   get_header(void **ptr, int *len)
   {
-    if (first_buf.m_ptr) {
+    if (first_buf) {
       Doc *doc = (Doc *)first_buf->data();
       *ptr = doc->hdr();
       *len = doc->hlen;
       return 0;
-    } else
-      return -1;
+    }
+
+    return -1;
   }
+
   int
   set_header(void *ptr, int len)
   {
@@ -252,10 +255,11 @@ struct CacheVC : public CacheVConnection {
     header_to_write_len = len;
     return 0;
   }
+
   int
   get_single_data(void **ptr, int *len)
   {
-    if (first_buf.m_ptr) {
+    if (first_buf) {
       Doc *doc = (Doc *)first_buf->data();
       if (doc->data_len() == doc->total_len) {
         *ptr = doc->data();
@@ -263,16 +267,20 @@ struct CacheVC : public CacheVConnection {
         return 0;
       }
     }
+
     return -1;
   }
+
   int
   get_volume_number() const
   {
     if (vol && vol->cache_vol) {
       return vol->cache_vol->vol_number;
     }
+
     return -1;
   }
+
   bool
   is_compressed_in_ram() const
   {
@@ -560,7 +568,7 @@ TS_INLINE int
 free_CacheVC(CacheVC *cont)
 {
   Debug("cache_free", "free %p", cont);
-  ProxyMutex *mutex = cont->mutex;
+  ProxyMutex *mutex = cont->mutex.get();
   Vol *vol = cont->vol;
   if (vol) {
     CACHE_DECREMENT_DYN_STAT(cont->base_stat + CACHE_STAT_ACTIVE);

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>.

Mime
View raw message