]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tests/CapturingStoreEntry.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / tests / CapturingStoreEntry.h
index b6d534a35e84a311616de201f11cda7089ebe961..655d7446c3d399981b18d6f93ef3523fda33f274 100644 (file)
@@ -1,17 +1,23 @@
+/*
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef SQUID_TESTS_CAPTURINGSTORE_ENTRY_H
 #define SQUID_TESTS_CAPTURINGSTORE_ENTRY_H
 
-#include "Mem.h"
 #include "Store.h"
 
 /* class that captures various call data for test analysis */
 
 class CapturingStoreEntry : public StoreEntry
 {
-
-public:
     MEMPROXY_CLASS(CapturingStoreEntry);
 
+public:
     CapturingStoreEntry() : _buffer_calls(0), _flush_calls(0) {}
 
     String _appended_text;
@@ -27,10 +33,11 @@ public:
     }
 
     virtual void append(char const * buf, int len) {
+        if (!buf || len < 0) // old 'String' can't handle these cases
+            return;
         _appended_text.append(buf, len);
     }
 };
 
-MEMPROXY_CLASS_INLINE(CapturingStoreEntry);
-
 #endif
+