]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/auth/AclMaxUserIp.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / auth / AclMaxUserIp.cc
index 9e674dcf0dc299a6f42d7e6d98b3685af1ecfc60..03560dd1a01705097b6b1383a35469a646b0309a 100644 (file)
@@ -1,8 +1,13 @@
 /*
- * DEBUG: section 28    Access Control
- * AUTHOR: Duane Wessels
+ * Copyright (C) 1996-2015 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.
  */
 
+/* DEBUG: section 28    Access Control */
+
 #include "squid.h"
 #include "acl/FilledChecklist.h"
 #include "auth/Acl.h"
 ACLFlag ACLMaxUserIP::SupportedFlags[] = {ACL_F_STRICT, ACL_F_END};
 
 ACLMaxUserIP::ACLMaxUserIP(char const *theClass) :
-        ACL(SupportedFlags),
-        class_(theClass),
-        maximum(0)
+    ACL(SupportedFlags),
+    class_(theClass),
+    maximum(0)
 {}
 
 ACLMaxUserIP::ACLMaxUserIP(ACLMaxUserIP const &old) :
-        class_(old.class_),
-        maximum(old.maximum)
+    class_(old.class_),
+    maximum(old.maximum)
 {
     flags = old.flags;
 }
@@ -146,19 +151,15 @@ ACLMaxUserIP::match(ACLChecklist *cl)
     }
 }
 
-wordlist *
+SBufList
 ACLMaxUserIP::dump() const
 {
+    SBufList sl;
     if (!maximum)
-        return NULL;
-
-    wordlist *W = NULL;
-
-    char buf[128];
-
-    snprintf(buf, sizeof(buf), "%lu", (unsigned long int) maximum);
-
-    wordlistAdd(&W, buf);
-
-    return W;
+        return sl;
+    SBuf s;
+    s.Printf("%d", maximum);
+    sl.push_back(s);
+    return sl;
 }
+