]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Import MemBuf::size(size) method from HEAD
authorHenrik Nordstrom <henrik@henriknordstrom.net>
Sun, 6 Apr 2008 00:35:11 +0000 (02:35 +0200)
committerHenrik Nordstrom <henrik@henriknordstrom.net>
Sun, 6 Apr 2008 00:35:11 +0000 (02:35 +0200)
src/MemBuf.h

index 6d06ea2ad62a997dc7a5433bd203b17bbfab938a..7185632dc6823ba0d6f2f4d4b167f3a71177272d 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: MemBuf.h,v 1.8 2006/08/21 00:50:41 robertc Exp $
+ * $Id: MemBuf.h,v 1.9 2007/12/21 23:48:04 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -60,6 +60,7 @@ public:
 
     // these space-related methods assume no growth and allow 0-termination
     char *space() { return buf + size; } // space to add data
+    char *space(mb_size_t required) { if (size + required > capacity) grow(size + required); return buf + size; } // space to add data
 
     mb_size_t spaceSize() const;
     bool hasSpace() const { return size+1 < capacity; }