]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Converted contentLen() to a StoreEntry class method.
authorwessels <>
Tue, 17 Apr 2007 12:07:50 +0000 (12:07 +0000)
committerwessels <>
Tue, 17 Apr 2007 12:07:50 +0000 (12:07 +0000)
src/Store.h
src/client_side.cc
src/store.cc
src/store_log.cc

index cb5572cde9d89fb64e1bb4b3f79732ee5aa91b04..adef41942607a99ca8217f2a4b8b430ff504ca9d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: Store.h,v 1.27 2007/04/17 05:40:18 wessels Exp $
+ * $Id: Store.h,v 1.28 2007/04/17 06:07:50 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -151,6 +151,7 @@ public:
     virtual int unlock();
     /* increate the memory lock count on the entry */
     virtual ssize_t objectLen() const;
+    virtual int contentLen() const;
 
     virtual void lock()
 
@@ -314,7 +315,6 @@ SQUIDCEXTERN void storeAppendVPrintf(StoreEntry *, const char *, va_list ap);
 SQUIDCEXTERN int storeCheckCachable(StoreEntry * e);
 SQUIDCEXTERN void storeSetPrivateKey(StoreEntry *);
 SQUIDCEXTERN ssize_t objectLen(const StoreEntry * e);
-SQUIDCEXTERN int contentLen(const StoreEntry * e);
 SQUIDCEXTERN int storeTooManyDiskFilesOpen(void);
 SQUIDCEXTERN void storeEntryReset(StoreEntry *);
 SQUIDCEXTERN void storeHeapPositionUpdate(StoreEntry *, SwapDir *);
index a4b5f9e6f2dc3829e4390c0cd864a7b35e409d0f..d5b1708e0d62fc511ad6e68b90c9c16983f9d42f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.747 2007/04/17 05:40:18 wessels Exp $
+ * $Id: client_side.cc,v 1.748 2007/04/17 06:07:50 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -495,7 +495,7 @@ ClientHttpRequest::logRequest()
         debug(33, 9) ("clientLogRequest: http.code='%d'\n", al.http.code);
 
         if (loggingEntry() && loggingEntry()->mem_obj)
-            al.cache.objectSize = contentLen(loggingEntry());
+            al.cache.objectSize = loggingEntry()->contentLen();
 
         al.cache.caddr = getConn().getRaw() != NULL ? getConn()->log_addr : no_addr;
 
index 924e59d1577eaec61dc900b96cd14c0211206f1e..4198ae92ed59136d6f9aebc94c6093ec226c8f8b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.604 2007/04/17 05:40:18 wessels Exp $
+ * $Id: store.cc,v 1.605 2007/04/17 06:07:50 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -1717,12 +1717,11 @@ StoreEntry::objectLen() const
 }
 
 int
-contentLen(const StoreEntry * e)
+StoreEntry::contentLen() const
 {
-    assert(e->mem_obj != NULL);
-    assert(e->getReply() != NULL);
-    return e->objectLen() - e->getReply()->hdr_sz;
-
+    assert(mem_obj != NULL);
+    assert(getReply() != NULL);
+    return objectLen() - getReply()->hdr_sz;
 }
 
 HttpReply const *
@@ -1934,7 +1933,7 @@ StoreEntry::modifiedSince(HttpRequest * request) const
     object_length = getReply()->content_length;
 
     if (object_length < 0)
-        object_length = contentLen(this);
+        object_length = contentLen();
 
     if (mod_time > request->ims) {
         debug(88, 3) ("--> YES: entry newer than client\n");
index b4c76d7808e9c2482a009a110bb66a7b21299a94..3f372a7cb2dc1b5d2e0a7816838586e5190c2625 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_log.cc,v 1.29 2007/04/13 23:12:31 wessels Exp $
+ * $Id: store_log.cc,v 1.30 2007/04/17 06:07:50 wessels Exp $
  *
  * DEBUG: section 20    Storage Manager Logging Functions
  * AUTHOR: Duane Wessels
@@ -96,7 +96,7 @@ storeLog(int tag, const StoreEntry * e)
                       (int) reply->expires,
                       reply->content_type.size() ? reply->content_type.buf() : "unknown",
                       reply->content_length,
-                      contentLen(e),
+                      e->contentLen(),
                       RequestMethodStr[mem->method],
                       mem->log_url);
     } else {