]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
renamed acl_size_t to AclSizeLimit, moved to own header in acl/
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 25 Sep 2012 15:36:18 +0000 (17:36 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 25 Sep 2012 15:36:18 +0000 (17:36 +0200)
Moved dwrite_q to disk.h, and _fde_disk to fde.h
Got rid of structs.h

src/HttpReply.cc
src/HttpRequest.cc
src/Makefile.am
src/SquidConfig.h
src/acl/AclSizeLimit.h [moved from src/structs.h with 76% similarity]
src/acl/Makefile.am
src/cache_cf.cc
src/disk.h
src/fde.h
src/ip/QosConfig.h
src/mem.cc

index 44bdc5a671f0d469e359214a41d6f91a6ff03a9f..e0dd59162a4d0c94f6a8b83eeda49de500b99b5a 100644 (file)
@@ -32,6 +32,7 @@
  */
 
 #include "squid.h"
+#include "acl/AclSizeLimit.h"
 #include "acl/FilledChecklist.h"
 #include "globals.h"
 #include "HttpBody.h"
@@ -45,7 +46,6 @@
 #include "SquidTime.h"
 #include "Store.h"
 #include "StrList.h"
-#include "structs.h"
 
 /* local constants */
 
@@ -598,7 +598,7 @@ HttpReply::calcMaxBodySize(HttpRequest& request)
 
     ACLFilledChecklist ch(NULL, &request, NULL);
     ch.reply = HTTPMSGLOCK(this); // XXX: this lock makes method non-const
-    for (acl_size_t *l = Config.ReplyBodySize; l; l = l -> next) {
+    for (AclSizeLimit *l = Config.ReplyBodySize; l; l = l -> next) {
         /* if there is no ACL list or if the ACLs listed match use this size value */
         if (!l->aclList || ch.fastCheck(l->aclList) == ACCESS_ALLOWED) {
             debugs(58, 4, HERE << "bodySizeMax=" << bodySizeMax);
index 2556e514c155c8fbef0cbfb1b4c490a4694b435e..e8e97c156a70ff1962ac0f15facb09425f68b046 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "squid.h"
 #include "AccessLogEntry.h"
+#include "acl/AclSizeLimit.h"
 #include "acl/FilledChecklist.h"
 #include "client_side.h"
 #include "DnsLookupDetails.h"
@@ -642,7 +643,7 @@ HttpRequest::getRangeOffsetLimit()
     ch.src_addr = client_addr;
     ch.my_addr =  my_addr;
 
-    for (acl_size_t *l = Config.rangeOffsetLimit; l; l = l -> next) {
+    for (AclSizeLimit *l = Config.rangeOffsetLimit; l; l = l -> next) {
         /* if there is no ACL list or if the ACLs listed match use this limit value */
         if (!l->aclList || ch.fastCheck(l->aclList) == ACCESS_ALLOWED) {
             debugs(58, 4, HERE << "rangeOffsetLimit=" << rangeOffsetLimit);
index 3ab295d09a0409ee93a326cf07178a1b56e7ad4e..926a931929206786f6b2158fecba90e6d43db630 100644 (file)
@@ -529,7 +529,6 @@ squid_SOURCES = \
        StoreSwapLogData.h \
        Server.cc \
        Server.h \
-       structs.h \
        swap_log_op.h \
        SwapDir.cc \
        SwapDir.h \
@@ -718,7 +717,6 @@ recv_announce_SOURCES = recv-announce.cc
 ## mem.cc wants ClientInfo.h
 ## libbase.la wants cbdata.*
 ## libbase.la wants MemBuf.*
-## structs.h wants HelperChildConfig.* (stub it)
 ufsdump_SOURCES = \
        ClientInfo.h \
        cbdata.h \
@@ -2488,7 +2486,6 @@ tests_test_http_range_LDFLAGS = $(LIBADD_DL)
 tests_test_http_range_DEPENDENCIES = \
        $(SQUID_CPPUNIT_LA)
 
-
 tests_testHttpParser_SOURCES = \
        Debug.h \
        HttpParser.cc \
@@ -2498,7 +2495,6 @@ tests_testHttpParser_SOURCES = \
        Mem.h \
        mem.cc \
        String.cc \
-       structs.h \
        cache_cf.h \
        YesNoNone.h \
        tests/stub_cache_cf.cc \
index bd3e9fbce8e9f81cd0f7ebf319e6272e7df7ca88..2f2c028dba1b693c73aa98e5d47039eff6258e53 100644 (file)
@@ -46,7 +46,7 @@ class sslproxy_cert_adapt;
 #endif
 
 class acl_access;
-class acl_size_t;
+class AclSizeLimit;
 class AclDenyInfoList;
 namespace Mgr {
 class ActionPasswordList;
@@ -123,7 +123,7 @@ public:
     int64_t maxChunkedRequestBodySize;
     size_t maxRequestBufferSize;
     size_t maxReplyHeaderSize;
-    acl_size_t *ReplyBodySize;
+    AclSizeLimit *ReplyBodySize;
 
     struct {
         unsigned short icp;
@@ -456,7 +456,7 @@ public:
     } comm_incoming;
     int max_open_disk_fds;
     int uri_whitespace;
-    acl_size_t *rangeOffsetLimit;
+    AclSizeLimit *rangeOffsetLimit;
 #if MULTICAST_MISS_STREAM
 
     struct {
similarity index 76%
rename from src/structs.h
rename to src/acl/AclSizeLimit.h
index 0355753f3273d32170479cedc7b8cc277b08b1b6..6a19f2df31b53e2bbe47c97c68ba7882c06de14e 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef SQUID_ACLSIZELIMIT_H_
+#define SQUID_ACLSIZELIMIT_H_
 /*
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
  *
  */
-#ifndef SQUID_STRUCTS_H
-#define SQUID_STRUCTS_H
-
-#include "defines.h"
-#include "typedefs.h"
 
 class ACLList;
-
-struct acl_size_t {
-    acl_size_t *next;
+/// representation of a class of Size-limit ACLs
+// a POD. TODO: convert to new ACL framework
+class AclSizeLimit {
+public:
+    AclSizeLimit *next;
     ACLList *aclList;
     int64_t size;
 };
 
-// POD
-class dwrite_q
-{
-public:
-    off_t file_offset;
-    char *buf;
-    size_t len;
-    size_t buf_offset;
-    dwrite_q *next;
-    FREE *free_func;
-};
-
-struct _fde_disk {
-    DWCB *wrt_handle;
-    void *wrt_handle_data;
-    dwrite_q *write_q;
-    dwrite_q *write_q_tail;
-    off_t offset;
-};
-
-#endif /* SQUID_STRUCTS_H */
+#endif /* SQUID_ACLSIZELIMIT_H_ */
index f9a4e54b768b75886240cfa6688c70a01805016f..8f808fb892823d490be3b8a792114028d6b77c21 100644 (file)
@@ -17,7 +17,6 @@ libstate_la_SOURCES = \
        Strategy.h \
        Strategised.cc \
        Strategised.h \
-       \
        FilledChecklist.cc \
        FilledChecklist.h \
        AclAddress.h \
@@ -35,7 +34,6 @@ libacls_la_SOURCES = \
        Time.h \
        TimeData.cc \
        TimeData.h \
-       \
        Asn.cc \
        Asn.h \
        Browser.cc \
@@ -106,11 +104,11 @@ libacls_la_SOURCES = \
        UrlPort.h \
        UserData.cc \
        UserData.h \
-       \
        AclNameList.h \
        AclDenyInfoList.h \
        Gadgets.cc \
-       Gadgets.h
+       Gadgets.h \
+       AclSizeLimit.h
 
 ## Add conditional sources
 ## TODO: move these to their respectful dirs when those dirs are created
index 3c4ee2c9d435a5ff2ec5ac4997ad89522bbb48dd..b8cb6c8325a4c6a80df25c8a8ace695a41dc7ba7 100644 (file)
@@ -35,6 +35,7 @@
 #include "acl/AclAddress.h"
 #include "acl/AclDenyInfoList.h"
 #include "acl/AclNameList.h"
+#include "acl/AclSizeLimit.h"
 #include "acl/Gadgets.h"
 #include "acl/MethodData.h"
 #include "anyp/PortCfg.h"
@@ -73,7 +74,6 @@
 #include "ssl/ProxyCerts.h"
 #include "Store.h"
 #include "StoreFileSystem.h"
-#include "structs.h"
 #include "SwapDir.h"
 #include "wordlist.h"
 #include "neighbors.h"
@@ -1565,12 +1565,12 @@ free_acl_nfmark(acl_nfmark ** head)
 }
 #endif /* SO_MARK */
 
-CBDATA_TYPE(acl_size_t);
+CBDATA_TYPE(AclSizeLimit);
 
 static void
-dump_acl_b_size_t(StoreEntry * entry, const char *name, acl_size_t * head)
+dump_acl_b_size_t(StoreEntry * entry, const char *name, AclSizeLimit * head)
 {
-    acl_size_t *l;
+    AclSizeLimit *l;
 
     for (l = head; l; l = l->next) {
         if (l->size != -1)
@@ -1587,19 +1587,19 @@ dump_acl_b_size_t(StoreEntry * entry, const char *name, acl_size_t * head)
 static void
 freed_acl_b_size_t(void *data)
 {
-    acl_size_t *l = static_cast<acl_size_t *>(data);
+    AclSizeLimit *l = static_cast<AclSizeLimit *>(data);
     aclDestroyAclList(&l->aclList);
 }
 
 static void
-parse_acl_b_size_t(acl_size_t ** head)
+parse_acl_b_size_t(AclSizeLimit ** head)
 {
-    acl_size_t *l;
-    acl_size_t **tail = head;  /* sane name below */
+    AclSizeLimit *l;
+    AclSizeLimit **tail = head;        /* sane name below */
 
-    CBDATA_INIT_TYPE_FREECB(acl_size_t, freed_acl_b_size_t);
+    CBDATA_INIT_TYPE_FREECB(AclSizeLimit, freed_acl_b_size_t);
 
-    l = cbdataAlloc(acl_size_t);
+    l = cbdataAlloc(AclSizeLimit);
 
     parse_b_int64_t(&l->size);
 
@@ -1612,10 +1612,10 @@ parse_acl_b_size_t(acl_size_t ** head)
 }
 
 static void
-free_acl_b_size_t(acl_size_t ** head)
+free_acl_b_size_t(AclSizeLimit ** head)
 {
     while (*head) {
-        acl_size_t *l = *head;
+        AclSizeLimit *l = *head;
         *head = l->next;
         l->next = NULL;
         cbdataFree(l);
index 9910fdbdeedd2595ba6d797f3211d4cbdbaf8f18..362842dec531e64f1934cf30c252d7999b1f5094 100644 (file)
@@ -36,8 +36,8 @@
 #include "typedefs.h"
 
 class MemBuf;
-// POD
 
+// POD
 class dread_ctrl
 {
 public:
@@ -50,6 +50,17 @@ public:
     void *client_data;
 };
 
+// POD
+class dwrite_q
+{
+public:
+    off_t file_offset;
+    char *buf;
+    size_t len;
+    size_t buf_offset;
+    dwrite_q *next;
+    FREE *free_func;
+};
 
 int file_open(const char *path, int mode);
 void file_close(int fd);
index b0f2ee17d40827fb20bb9c5b0874453924a2a8d7..57ee4241b760d26f3d6e9787062882b5242f10ab 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -31,8 +31,8 @@
 #define SQUID_FDE_H
 
 #include "comm.h"
+#include "defines.h"
 #include "ip/Address.h"
-#include "structs.h"
 
 #if USE_SSL
 #include <openssl/ssl.h>
 #if USE_DELAY_POOLS
 class ClientInfo;
 #endif
+
 class PconnPool;
+class dwrite_q;
+class _fde_disk {
+public:
+    DWCB *wrt_handle;
+    void *wrt_handle_data;
+    dwrite_q *write_q;
+    dwrite_q *write_q_tail;
+    off_t offset;
+};
 
 class fde
 {
index 2e277ef4902fdc9cce1d0bd090e8191bc881f52a..2b801648cf826c0550e5341e880291993431c8b2 100644 (file)
@@ -3,7 +3,6 @@
 
 #include "hier_code.h"
 #include "ip/forward.h"
-#include "structs.h"
 
 #if HAVE_LIBNETFILTER_CONNTRACK_LIBNETFILTER_CONNTRACK_H
 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
@@ -21,6 +20,7 @@ class ACLList;
 class fde;
 
 // TODO: move to new ACL framework
+// not integrated in namespace, as this class uses a strange CBDATA definition
 // POD
 class acl_tos {
 public:
@@ -29,6 +29,7 @@ public:
     tos_t tos;
 };
 // TODO: move to new ACL framework
+// not integrated in namespace, as this class uses a strange CBDATA definition
 // POD
 class acl_nfmark {
 public:
@@ -37,7 +38,6 @@ public:
     nfmark_t nfmark;
 };
 
-
 namespace Ip
 {
 
index 56cad3e3d4955012888e24b9a64977870e1524f7..4a947661ffbb9c4126168c68a10a190b55542019 100644 (file)
@@ -49,7 +49,6 @@
 #include "SquidTime.h"
 #include "Store.h"
 #include "StoreEntryStream.h"
-#include "structs.h"
 
 #if HAVE_IOMANIP
 #include <iomanip>