]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix build error on Visual Studio and gcc 3.3
authorserassio <>
Tue, 14 Aug 2007 16:09:23 +0000 (16:09 +0000)
committerserassio <>
Tue, 14 Aug 2007 16:09:23 +0000 (16:09 +0000)
Patch by Alex Rousskov
See http://www.codecomments.com/archive292-2005-2-396222.html

src/StoreEntryStream.h

index 8a254351b66065714162ee7493282ba6f4baff21..9ffd25dce0daf305bed7436b1f08fe54c8669b64 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: StoreEntryStream.h,v 1.4 2007/08/07 20:02:51 rousskov Exp $
+ * $Id: StoreEntryStream.h,v 1.5 2007/08/14 10:09:23 serassio Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -116,7 +116,11 @@ class StoreEntryStream : public std::ostream
 
 public:
     /* create a stream for writing text etc into theEntry */
-    StoreEntryStream(StoreEntry *entry): theBuffer(entry) { this->init(&theBuffer); }
+    // See http://www.codecomments.com/archive292-2005-2-396222.html
+    StoreEntryStream(StoreEntry *entry): std::ostream(0), theBuffer(entry) {
+        rdbuf(&theBuffer); // set the buffer to now-initialized theBuffer
+        clear(); //clear badbit set by calling init(0)
+    }
 
 private:
     StoreEntryStreamBuf theBuffer;