---------------------
PatchSet 5119 
Date: 2007/07/31 21:09:45
Author: chtsanti
Branch: squid3-largeobj
Tag: (none) 
Log:
- Config.maxRequestBodySize (request_body_max_size configuration parameter) must be 64bit integer to allow uploading large files to an http server

- Config.rangeOffsetLimit (range_offset_limit configuration parameter) it is better to be a 64bit integer because refered to file offsets

- Some convertions of variables to 64bit integers, for which I am not sure if really needed but they used to hold results of 64bit operations and I think it is not safe to downgrade 64bit integers ...

Members: 
	src/HttpHdrRange.cc:1.13.10.3->1.13.10.4 
	src/MemObject.cc:1.22.6.4->1.22.6.5 
	src/MemObject.h:1.13.10.3->1.13.10.4 
	src/cf.data.pre:1.117.2.2->1.117.2.3 
	src/client_side.cc:1.121.2.10->1.121.2.11 
	src/stmem.cc:1.16.14.4->1.16.14.5 
	src/stmem.h:1.9.14.3->1.9.14.4 
	src/store_client.cc:1.29.2.8->1.29.2.9 
	src/store_swapout.cc:1.19.2.8->1.19.2.9 
	src/structs.h:1.106.2.2->1.106.2.3 

Index: squid3/src/HttpHdrRange.cc
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/HttpHdrRange.cc,v
retrieving revision 1.13.10.3
retrieving revision 1.13.10.4
diff -u -r1.13.10.3 -r1.13.10.4
--- squid3/src/HttpHdrRange.cc	18 Jun 2007 20:59:34 -0000	1.13.10.3
+++ squid3/src/HttpHdrRange.cc	31 Jul 2007 21:09:45 -0000	1.13.10.4
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHdrRange.cc,v 1.13.10.3 2007/06/18 20:59:34 chtsanti Exp $
+ * $Id: HttpHdrRange.cc,v 1.13.10.4 2007/07/31 21:09:45 chtsanti Exp $
  *
  * DEBUG: section 64    HTTP Range Header
  * AUTHOR: Alex Rousskov
@@ -538,7 +538,7 @@
         /* not a range request */
         return false;
 
-    if (-1 == (ssize_t)Config.rangeOffsetLimit)
+    if (-1 == Config.rangeOffsetLimit)
         /* disabled */
         return false;
 
@@ -546,7 +546,7 @@
         /* tail request */
         return true;
 
-    if ((int64_t)Config.rangeOffsetLimit >= firstOffset())
+    if (Config.rangeOffsetLimit >= firstOffset())
         /* below the limit */
         return false;
 
Index: squid3/src/MemObject.cc
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/MemObject.cc,v
retrieving revision 1.22.6.4
retrieving revision 1.22.6.5
diff -u -r1.22.6.4 -r1.22.6.5
--- squid3/src/MemObject.cc	1 May 2007 21:03:42 -0000	1.22.6.4
+++ squid3/src/MemObject.cc	31 Jul 2007 21:09:45 -0000	1.22.6.5
@@ -1,6 +1,6 @@
 
 /*
- * $Id: MemObject.cc,v 1.22.6.4 2007/05/01 21:03:42 dwsquid Exp $
+ * $Id: MemObject.cc,v 1.22.6.5 2007/07/31 21:09:45 chtsanti Exp $
  *
  * DEBUG: section 19    Store Memory Primitives
  * AUTHOR: Robert Collins
@@ -215,14 +215,14 @@
 {
     mb->Printf("\t%s %s\n",
                RequestMethodStr[method], log_url);
-    mb->Printf("\tinmem_lo: %d\n", (int) inmem_lo);
-    mb->Printf("\tinmem_hi: %d\n", (int) data_hdr.endOffset());
-    mb->Printf("\tswapout: %d bytes queued\n",
-               (int) swapout.queue_offset);
+    mb->Printf("\tinmem_lo: %"PRId64"\n", inmem_lo);
+    mb->Printf("\tinmem_hi: %"PRId64"\n", data_hdr.endOffset());
+    mb->Printf("\tswapout: %"PRId64" bytes queued\n",
+               swapout.queue_offset);
 
     if (swapout.sio.getRaw())
-        mb->Printf("\tswapout: %d bytes written\n",
-                   (int) swapout.sio->offset());
+        mb->Printf("\tswapout: %"PRId64" bytes written\n",
+                   (int64_t) swapout.sio->offset());
 
     StoreClientStats statsVisitor(mb);
 
@@ -235,7 +235,7 @@
     return data_hdr.endOffset();
 }
 
-size_t
+int64_t
 MemObject::size() const
 {
     if (object_sz < 0)
@@ -268,7 +268,7 @@
 bool
 MemObject::readAheadPolicyCanRead() const
 {
-    return (size_t)endOffset() - getReply()->hdr_sz < lowestMemReaderOffset() + (Config.readAheadGap << 10);
+    return endOffset() - (int64_t)getReply()->hdr_sz < lowestMemReaderOffset() + ((int64_t)Config.readAheadGap << 10);
 }
 
 void
@@ -371,7 +371,7 @@
 bool
 MemObject::isContiguous() const
 {
-    bool result = data_hdr.hasContigousContentRange (Range<size_t>(inmem_lo, endOffset()));
+    bool result = data_hdr.hasContigousContentRange (Range<int64_t>(inmem_lo, endOffset()));
     /* XXX : make this higher level */
     debugs (19, result ? 4 :3, "MemObject::isContiguous: Returning " << (result ? "true" : "false"));
     return result;
Index: squid3/src/MemObject.h
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/MemObject.h,v
retrieving revision 1.13.10.3
retrieving revision 1.13.10.4
diff -u -r1.13.10.3 -r1.13.10.4
--- squid3/src/MemObject.h	18 Jun 2007 20:59:34 -0000	1.13.10.3
+++ squid3/src/MemObject.h	31 Jul 2007 21:09:45 -0000	1.13.10.4
@@ -1,6 +1,6 @@
 
 /*
- * $Id: MemObject.h,v 1.13.10.3 2007/06/18 20:59:34 chtsanti Exp $
+ * $Id: MemObject.h,v 1.13.10.4 2007/07/31 21:09:45 chtsanti Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -64,7 +64,7 @@
     void replaceHttpReply(HttpReply *newrep);
     void stat (MemBuf * mb) const;
     int64_t endOffset () const;
-    size_t size() const;
+    int64_t size() const;
     void reset();
     int64_t lowestMemReaderOffset() const;
     bool readAheadPolicyCanRead() const;
Index: squid3/src/cf.data.pre
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/cf.data.pre,v
retrieving revision 1.117.2.2
retrieving revision 1.117.2.3
diff -u -r1.117.2.2 -r1.117.2.3
--- squid3/src/cf.data.pre	22 Jul 2007 08:50:28 -0000	1.117.2.2
+++ squid3/src/cf.data.pre	31 Jul 2007 21:09:45 -0000	1.117.2.3
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.117.2.2 2007/07/22 08:50:28 chtsanti Exp $
+# $Id: cf.data.pre,v 1.117.2.3 2007/07/31 21:09:45 chtsanti Exp $
 #
 # SQUID Web Proxy Cache		http://www.squid-cache.org/
 # ----------------------------------------------------------
@@ -2097,7 +2097,7 @@
 
 NAME: request_body_max_size
 COMMENT: (KB)
-TYPE: b_size_t
+TYPE: b_int64_t
 DEFAULT: 0 KB
 LOC: Config.maxRequestBodySize
 DOC_START
@@ -2304,7 +2304,7 @@
 
 NAME: range_offset_limit
 COMMENT: (bytes)
-TYPE: b_size_t
+TYPE: b_int64_t
 LOC: Config.rangeOffsetLimit
 DEFAULT: 0 KB
 DOC_START
Index: squid3/src/client_side.cc
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/client_side.cc,v
retrieving revision 1.121.2.10
retrieving revision 1.121.2.11
diff -u -r1.121.2.10 -r1.121.2.11
--- squid3/src/client_side.cc	22 Jul 2007 08:50:28 -0000	1.121.2.10
+++ squid3/src/client_side.cc	31 Jul 2007 21:09:45 -0000	1.121.2.11
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.121.2.10 2007/07/22 08:50:28 chtsanti Exp $
+ * $Id: client_side.cc,v 1.121.2.11 2007/07/31 21:09:45 chtsanti Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -139,8 +139,8 @@
 static void clientSetKeepaliveFlag(ClientHttpRequest *);
 static int clientIsContentLengthValid(HttpRequest * r);
 static bool okToAccept();
-static int clientIsRequestBodyValid(int bodyLength);
-static int clientIsRequestBodyTooLargeForPolicy(size_t bodyLength);
+static int clientIsRequestBodyValid(int64_t bodyLength);
+static int clientIsRequestBodyTooLargeForPolicy(int64_t bodyLength);
 
 static void clientUpdateStatHistCounters(log_type logType, int svc_time);
 static void clientUpdateStatCounters(log_type logType);
@@ -683,7 +683,7 @@
 }
 
 int
-clientIsRequestBodyValid(int bodyLength)
+clientIsRequestBodyValid(int64_t bodyLength)
 {
     if (bodyLength >= 0)
         return 1;
@@ -692,7 +692,7 @@
 }
 
 int
-clientIsRequestBodyTooLargeForPolicy(size_t bodyLength)
+clientIsRequestBodyTooLargeForPolicy(int64_t bodyLength)
 {
     if (Config.maxRequestBodySize &&
             bodyLength > Config.maxRequestBodySize)
Index: squid3/src/stmem.cc
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/stmem.cc,v
retrieving revision 1.16.14.4
retrieving revision 1.16.14.5
diff -u -r1.16.14.4 -r1.16.14.5
--- squid3/src/stmem.cc	30 Apr 2007 17:08:16 -0000	1.16.14.4
+++ squid3/src/stmem.cc	31 Jul 2007 21:09:46 -0000	1.16.14.5
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stmem.cc,v 1.16.14.4 2007/04/30 17:08:16 dwsquid Exp $
+ * $Id: stmem.cc,v 1.16.14.5 2007/07/31 21:09:46 chtsanti Exp $
  *
  * DEBUG: section 19    Store Memory Primitives
  * AUTHOR: Harvest Derived
@@ -301,9 +301,9 @@
 }
 
 bool
-mem_hdr::hasContigousContentRange(Range<size_t> const & range) const
+mem_hdr::hasContigousContentRange(Range<int64_t> const & range) const
 {
-    size_t currentStart = range.start;
+    int64_t currentStart = range.start;
 
     while (mem_node *curr = getBlockContainingLocation(currentStart)) {
         currentStart = curr->end();
Index: squid3/src/stmem.h
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/stmem.h,v
retrieving revision 1.9.14.3
retrieving revision 1.9.14.4
diff -u -r1.9.14.3 -r1.9.14.4
--- squid3/src/stmem.h	20 Apr 2007 22:31:23 -0000	1.9.14.3
+++ squid3/src/stmem.h	31 Jul 2007 21:09:47 -0000	1.9.14.4
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stmem.h,v 1.9.14.3 2007/04/20 22:31:23 dwsquid Exp $
+ * $Id: stmem.h,v 1.9.14.4 2007/07/31 21:09:47 chtsanti Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -53,7 +53,7 @@
     int64_t endOffset () const;
     int64_t freeDataUpto (int64_t);
     ssize_t copy (StoreIOBuffer const &) const;
-    bool hasContigousContentRange(Range<size_t> const &range) const;
+    bool hasContigousContentRange(Range<int64_t> const &range) const;
     /* success or fail */
     bool write (StoreIOBuffer const &);
     void dump() const;
Index: squid3/src/store_client.cc
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/store_client.cc,v
retrieving revision 1.29.2.8
retrieving revision 1.29.2.9
diff -u -r1.29.2.8 -r1.29.2.9
--- squid3/src/store_client.cc	18 Jun 2007 20:59:35 -0000	1.29.2.8
+++ squid3/src/store_client.cc	31 Jul 2007 21:09:47 -0000	1.29.2.9
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_client.cc,v 1.29.2.8 2007/06/18 20:59:35 chtsanti Exp $
+ * $Id: store_client.cc,v 1.29.2.9 2007/07/31 21:09:47 chtsanti Exp $
  *
  * DEBUG: section 90    Storage Manager Client-Side Interface
  * AUTHOR: Duane Wessels
@@ -765,15 +765,15 @@
         return 1;
     }
 
-    size_t expectlen = entry->getReply()->content_length + entry->getReply()->hdr_sz;
+    int64_t expectlen = entry->getReply()->content_length + entry->getReply()->hdr_sz;
 
     if (expectlen < 0)
         /* expectlen is < 0 if *no* information about the object has been recieved */
         return 1;
 
-    size_t curlen = (size_t) mem->endOffset ();
+    int64_t curlen =  mem->endOffset ();
 
-    size_t minlen = (size_t) Config.quickAbort.min << 10;
+    int64_t minlen = (int64_t) Config.quickAbort.min << 10;
 
     if (minlen < 0) {
         debugs(90, 3, "CheckQuickAbort2: NO disabled");
@@ -790,7 +790,7 @@
         return 0;
     }
 
-    if ((expectlen - curlen) > (Config.quickAbort.max << 10)) {
+    if ((expectlen - curlen) > ((int64_t)Config.quickAbort.max << 10)) {
         debugs(90, 3, "CheckQuickAbort2: YES too much left to go");
         return 1;
     }
@@ -800,7 +800,7 @@
         return 0;
     }
 
-    if ((curlen / (expectlen / 100)) > (size_t)Config.quickAbort.pct) {
+    if ((curlen / (expectlen / 100)) > ((int64_t)Config.quickAbort.pct)) {
         debugs(90, 3, "CheckQuickAbort2: NO past point of no return");
         return 0;
     }
Index: squid3/src/store_swapout.cc
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/store_swapout.cc,v
retrieving revision 1.19.2.8
retrieving revision 1.19.2.9
diff -u -r1.19.2.8 -r1.19.2.9
--- squid3/src/store_swapout.cc	1 May 2007 21:03:44 -0000	1.19.2.8
+++ squid3/src/store_swapout.cc	31 Jul 2007 21:09:47 -0000	1.19.2.9
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_swapout.cc,v 1.19.2.8 2007/05/01 21:03:44 dwsquid Exp $
+ * $Id: store_swapout.cc,v 1.19.2.9 2007/07/31 21:09:47 chtsanti Exp $
  *
  * DEBUG: section 20    Storage Manager Swapout Functions
  * AUTHOR: Duane Wessels
@@ -165,7 +165,7 @@
         if (anEntry->swap_status != SWAPOUT_WRITING)
             break;
 
-        ssize_t swapout_size = (ssize_t) (mem->endOffset() - mem->swapout.queue_offset);
+        int64_t swapout_size = mem->endOffset() - mem->swapout.queue_offset;
 
         if (anEntry->store_status == STORE_PENDING)
             if (swapout_size < SM_PAGE_SIZE)
Index: squid3/src/structs.h
===================================================================
RCS file: /cvsroot/squid-sf//squid3/src/structs.h,v
retrieving revision 1.106.2.2
retrieving revision 1.106.2.3
diff -u -r1.106.2.2 -r1.106.2.3
--- squid3/src/structs.h	22 Jul 2007 08:50:40 -0000	1.106.2.2
+++ squid3/src/structs.h	31 Jul 2007 21:09:47 -0000	1.106.2.3
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.106.2.2 2007/07/22 08:50:40 chtsanti Exp $
+ * $Id: structs.h,v 1.106.2.3 2007/07/31 21:09:47 chtsanti Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -254,7 +254,7 @@
 
     Timeout;
     size_t maxRequestHeaderSize;
-    size_t maxRequestBodySize;
+    int64_t maxRequestBodySize;
     size_t maxReplyHeaderSize;
     acl_size_t *ReplyBodySize;
 
@@ -660,7 +660,7 @@
     comm_incoming;
     int max_open_disk_fds;
     int uri_whitespace;
-    size_t rangeOffsetLimit;
+    int64_t rangeOffsetLimit;
 #if MULTICAST_MISS_STREAM
 
     struct
