]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Code cleanup.
authoramosjeffries <>
Wed, 31 Oct 2007 10:52:15 +0000 (10:52 +0000)
committeramosjeffries <>
Wed, 31 Oct 2007 10:52:15 +0000 (10:52 +0000)
src/ICP.h
src/Makefile.am
src/SquidTime.h
src/cache_cf.cc
src/cache_manager.cc
src/client_side.h
src/comm.cc
src/debug.cc

index c21717352cb750d3075faf276211ddd36a1dcd9c..fd3f9045e9ed8346bd4a196695f73f241f2431b2 100644 (file)
--- a/src/ICP.h
+++ b/src/ICP.h
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ICP.h,v 1.8 2007/09/21 11:41:52 amosjeffries Exp $
+ * $Id: ICP.h,v 1.9 2007/10/31 04:52:15 amosjeffries Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -41,7 +41,6 @@
  * DO NOT add more move fields on pain of breakage.
  * DO NOT add virtual methods.
  */
-
 struct _icp_common_t
 {
     unsigned char opcode;      /* opcode */
index 9f208abf7c035e150a5f8c470bbd77c9cc5ceea1..d4775064a9513753034e1a81d62cc76dc31b89d7 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.am,v 1.192 2007/09/19 08:54:50 hno Exp $
+#  $Id: Makefile.am,v 1.193 2007/10/31 04:52:15 amosjeffries Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -1126,6 +1126,28 @@ check_PROGRAMS+= \
        tests/testURL \
        @STORE_TESTS@
 
+### Template for new Unit Test Program
+## - add tests/testX to check_PROGRAMS above.
+## - copy template below and substitue X for class name
+## - add other component .(h|cc) files needed to link and run tests
+##
+##NP: (TESTSOURCES) defines stub debugs() and new/delete for testing
+##
+#tests_testX_SOURCES=\
+#      tests/testX.h \
+#      tests/testX.cc \
+#      tests/testMain.cc \
+#      X.h \
+#      X.cc \
+#      $(TESTSOURCES)
+#tests_testX_LDFLAGS = $(LIBADD_DL)
+#tests_testX_LDADD=\
+#      @SQUID_CPPUNIT_LIBS@ \
+#      @SQUID_CPPUNIT_LA@ \
+#      -L../lib -lmiscutil
+#tests_testX_DEPENDENCIES= @SQUID_CPPUNIT_LA@ \
+#      $(top_builddir)/lib/libmiscutil.a
+
 tests_testAuth_SOURCES= tests/testAuth.cc tests/testMain.cc  tests/testAuth.h $(TESTSOURCES) \
        authenticate.cc \
        ConfigParser.cc \
index 23cb493952a643e1600ff225e5db9640894f58f5..499521dcd623bdc7b797cdb44889a1d32db6aa53 100644 (file)
@@ -1,6 +1,5 @@
-
 /*
- * $Id: SquidTime.h,v 1.2 2006/08/12 01:43:11 robertc Exp $
+ * $Id: SquidTime.h,v 1.3 2007/10/31 04:52:16 amosjeffries Exp $
  *
  * DEBUG: section 21    Time Functions
  * AUTHOR: Harvest Derived
@@ -32,7 +31,6 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
  *
  */
-
 #ifndef   SQUID_TIME_H
 #define   SQUID_TIME_H
 
@@ -42,16 +40,15 @@ extern time_t squid_curtime;        /* 0 */
 
 time_t getCurrentTime(void);
 
-/* event class for doing synthetic time etc */
-
+/** event class for doing synthetic time etc */
 class TimeEngine
 {
 
 public:
     virtual ~TimeEngine();
-    /* tick the clock - update from the OS or other time source, */
+
+    /** tick the clock - update from the OS or other time source, */
     virtual void tick();
 };
 
-
 #endif /* SQUID_TIME_H */
index 2c454ebd9b0d9c52b8ba0363703da7f1c03d96b6..f3660f27cbf227b4d1af2387218310286ed8dc95 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.523 2007/10/22 23:35:32 amosjeffries Exp $
+ * $Id: cache_cf.cc,v 1.524 2007/10/31 04:52:16 amosjeffries Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -125,6 +125,7 @@ static void free_http_header_replace(header_mangler * header);
 static void parse_denyinfo(acl_deny_info_list ** var);
 static void dump_denyinfo(StoreEntry * entry, const char *name, acl_deny_info_list * var);
 static void free_denyinfo(acl_deny_info_list ** var);
+
 #if USE_WCCPv2
 static void parse_sockaddr_in_list(sockaddr_in_list **);
 static void dump_sockaddr_in_list(StoreEntry *, const char *, const sockaddr_in_list *);
@@ -132,10 +133,12 @@ static void free_sockaddr_in_list(sockaddr_in_list **);
 #if CURRENTLY_UNUSED
 static int check_null_sockaddr_in_list(const sockaddr_in_list *);
 #endif /* CURRENTLY_UNUSED */
-#endif
+#endif /* USE_WCCPv2 */
+
 static void parse_http_port_list(http_port_list **);
 static void dump_http_port_list(StoreEntry *, const char *, const http_port_list *);
 static void free_http_port_list(http_port_list **);
+
 #if USE_SSL
 static void parse_https_port_list(https_port_list **);
 static void dump_https_port_list(StoreEntry *, const char *, const https_port_list *);
@@ -144,6 +147,7 @@ static void free_https_port_list(https_port_list **);
 static int check_null_https_port_list(const https_port_list *);
 #endif
 #endif /* USE_SSL */
+
 static void parse_b_size_t(size_t * var);
 static void parse_b_int64_t(int64_t * var);
 
index d50d3ebad4a2a12f034c6552df488bcb71200c2f..f8b07f7d45d1d4e528e61264534c50c829f9fe0e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_manager.cc,v 1.47 2007/04/28 22:26:37 hno Exp $
+ * $Id: cache_manager.cc,v 1.48 2007/10/31 04:52:16 amosjeffries Exp $
  *
  * DEBUG: section 16    Cache Manager Objects
  * AUTHOR: Duane Wessels
@@ -383,7 +383,7 @@ cachemgrMenu(StoreEntry * sentry)
     CacheManagerAction *a;
 
     for (a = ActionTable; a != NULL; a = a->next) {
-        storeAppendPrintf(sentry, " %-22s\t%s\t%s\n",
+        storeAppendPrintf(sentry, " %-22s\t%-32s\t%s\n",
                           a->action, a->desc, cachemgrActionProtection(a));
     }
 }
index 6497b2c2482d76883472166f37fb831c7522a14e..5f40f37e1e23b972c1921798a6fbd2a8ca514c3d 100644 (file)
@@ -1,6 +1,5 @@
-
 /*
- * $Id: client_side.h,v 1.25 2007/09/28 00:22:38 hno Exp $
+ * $Id: client_side.h,v 1.26 2007/10/31 04:52:16 amosjeffries Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -126,7 +125,6 @@ private:
     bool connRegistered_;
 };
 
-
 /* A connection to a socket */
 class ConnStateData : public BodyProducer, public RefCountable
 {
index 8730440657532364cc395301ea5c764ae0c9e21b..02157c538987b29b7093beee9fe69203d6049074 100644 (file)
@@ -1,6 +1,5 @@
-
 /*
- * $Id: comm.cc,v 1.437 2007/09/25 13:24:59 hno Exp $
+ * $Id: comm.cc,v 1.438 2007/10/31 04:52:16 amosjeffries Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -447,7 +446,7 @@ CommCallbackData::deRegisterSelf()
     dlinkDelete(&fd_node, &(fdc_table[result.fd].CommCallbackList));
 }
 
-/*
+/**
  * add an IO callback
  *
  * IO callbacks are added when we want to notify someone that some IO
@@ -476,7 +475,7 @@ CommCallbackData::callACallback()
     callCallback();
 }
 
-/*
+/**
  * call the IO callbacks
  *
  * This should be called before comm_select() so code can attempt to
@@ -522,7 +521,7 @@ comm_iocallbackpending(void)
     return (CommCallbackList.head != NULL) || (commfd_completed_events.head != NULL);
 }
 
-/*
+/**
  * Attempt a read
  *
  * If the read attempt succeeds or fails, call the callback.
@@ -562,7 +561,7 @@ commHandleRead(int fd, void *data)
     commSetSelect(fd, COMM_SELECT_READ, commHandleRead, data, 0);
 }
 
-/*
+/**
  * Queue a read. handler/handler_data are called when the read
  * completes, on error, or on file descriptor close.
  */
@@ -581,7 +580,7 @@ comm_read(int fd, char *buf, int size, IOCB *handler, void *handler_data)
     commSetSelect(fd, COMM_SELECT_READ, commHandleRead, COMMIO_FD_READCB(fd), 0);
 }
 
-/*
+/**
  * Empty the read buffers
  *
  * This is a magical routine that empties the read buffers.
@@ -610,7 +609,7 @@ requireOpenAndActive(int const fd)
     assert(fdc_table[fd].active == 1);
 }
 
-/*
+/**
  * Return whether the FD has a pending completed callback.
  */
 int
@@ -644,7 +643,7 @@ fdc_t::findCallback(P predicate)
     return false;
 }
 
-/*
+/**
  * return whether a file descriptor has a read handler
  *
  * Assumptions: the fd is open
@@ -672,7 +671,7 @@ comm_has_pending_read(int fd)
     return COMMIO_FD_READCB(fd)->active && (! COMMIO_FD_READCB(fd)->completed);
 }
 
-/*
+/**
  * Cancel a pending read. Assert that we have the right parameters,
  * and that there are no pending read events!
  *
@@ -695,7 +694,7 @@ comm_read_cancel(int fd, IOCB *callback, void *data)
 }
 
 
-/*
+/**
  * Open a filedescriptor, set some sane defaults
  * XXX DPW 2006-05-30 what is the point of this?
  */
@@ -710,13 +709,11 @@ fdc_open(int fd, unsigned int type, char const *desc)
 }
 
 
-/*
+/**
  * synchronous wrapper around udp socket functions
  */
-
 int
 comm_udp_recvfrom(int fd, void *buf, size_t len, int flags,
-
                   struct sockaddr *from, socklen_t *fromlen)
 {
     statCounter.syscalls.sock.recvfroms++;
@@ -743,7 +740,7 @@ comm_has_incomplete_write(int fd)
     return COMMIO_FD_WRITECB(fd)->active;
 }
 
-/*
+/**
  * Queue a write. handler/handler_data are called when the write fully
  * completes, on error, or on file descriptor close.
  */
@@ -780,10 +777,8 @@ comm_local_port(int fd)
 }
 
 static comm_err_t
-
 commBind(int s, struct IN_ADDR in_addr, u_short port)
 {
-
     struct sockaddr_in S;
 
     memset(&S, '\0', sizeof(S));
@@ -802,12 +797,13 @@ commBind(int s, struct IN_ADDR in_addr, u_short port)
     return COMM_ERROR;
 }
 
-/* Create a socket. Default is blocking, stream (TCP) socket.  IO_TYPE
- * is OR of flags specified in comm.h. Defaults TOS */
+/**
+ * Create a socket. Default is blocking, stream (TCP) socket.  IO_TYPE
+ * is OR of flags specified in comm.h. Defaults TOS
+ */
 int
 comm_open(int sock_type,
           int proto,
-
           struct IN_ADDR addr,
           u_short port,
           int flags,
@@ -831,18 +827,19 @@ comm_set_tos(int fd, int tos)
             debugs(50, 1, "comm_set_tos: setsockopt(IP_TOS) on FD " << fd << ": " << xstrerror());
        return x;
 #else
-        debugs(50, 0, "comm_set_tos: setsockopt(IP_TOS) not supported on this platform");
+        debugs(50, 0, "WARNING: setsockopt(IP_TOS) not supported on this platform");
        return -1;
 #endif
 }
 
 
-/* Create a socket. Default is blocking, stream (TCP) socket.  IO_TYPE
- * is OR of flags specified in defines.h:COMM_* */
+/**
+ * Create a socket. Default is blocking, stream (TCP) socket.  IO_TYPE
+ * is OR of flags specified in defines.h:COMM_*
+ */
 int
 comm_openex(int sock_type,
             int proto,
-
             struct IN_ADDR addr,
             u_short port,
             int flags,
index 72178fa4c02a02708e3da05984ab3a2103923276..550797320e9f3bb8f447da2cfd95251d90569e7b 100644 (file)
@@ -1,6 +1,5 @@
-
 /*
- * $Id: debug.cc,v 1.103 2007/08/01 23:04:23 amosjeffries Exp $
+ * $Id: debug.cc,v 1.104 2007/10/31 04:52:16 amosjeffries Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived