]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceFormat: enforcement
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 23 Aug 2009 09:30:49 +0000 (03:30 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 23 Aug 2009 09:30:49 +0000 (03:30 -0600)
124 files changed:
helpers/basic_auth/MSNT/rfcnb-util.c
helpers/basic_auth/NCSA/crypt_md5.c
helpers/basic_auth/squid_radius_auth/radius-util.c
helpers/external_acl/ip_user/dict.c
helpers/negotiate_auth/squid_kerb_auth/base64.c
helpers/negotiate_auth/squid_kerb_auth/spnegohelp/derparse.h
helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnego.h
helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegohelp.h
helpers/negotiate_auth/squid_kerb_auth/spnegohelp/spnegoparse.h
helpers/negotiate_auth/squid_kerb_auth/squid_kerb_auth.c
helpers/ntlm_auth/fakeauth/ntlm.h
helpers/ntlm_auth/mswin_sspi/libntlmssp.c
helpers/ntlm_auth/mswin_sspi/ntlm.h
helpers/ntlm_auth/smb_lm/smbval/rfcnb-util.c
helpers/ntlm_auth/smb_lm/smbval/smblib-priv.h
include/asn1.h
include/parse.h
include/radix.h
include/snmp_api.h
include/snmp_api_error.h
include/snmp_api_util.h
include/snmp_client.h
include/snmp_coexist.h
include/snmp_error.h
include/snmp_msg.h
include/snmp_pdu.h
include/snmp_util.h
include/snmp_vars.h
lib/dirent.c
lib/getaddrinfo.c
lib/radix.c
lib/rfc1123.c
lib/win32lib.c
snmplib/mib.c
snmplib/parse.c
snmplib/snmp_pdu.c
snmplib/snmp_vars.c
snmplib/snmplib_debug.c
src/AccessLogEntry.h
src/BodyPipe.cc
src/ChunkedCodingParser.cc
src/CommCalls.h
src/DnsLookupDetails.cc
src/HierarchyLogEntry.h
src/HttpHeader.cc
src/HttpHeaderTools.cc
src/HttpMsg.h
src/HttpRequest.cc
src/Server.cc
src/Server.h
src/Store.h
src/TextException.cc
src/TextException.h
src/access_log.cc
src/acl/MethodData.cc
src/adaptation/AccessCheck.cc
src/adaptation/Config.cc
src/adaptation/History.cc
src/adaptation/History.h
src/adaptation/Initiate.cc
src/adaptation/Iterator.cc
src/adaptation/Iterator.h
src/adaptation/ServiceConfig.cc
src/adaptation/ServiceConfig.h
src/adaptation/ServiceFilter.cc
src/adaptation/ServiceGroups.cc
src/adaptation/ServiceGroups.h
src/adaptation/ecap/Config.h
src/adaptation/ecap/Host.h
src/adaptation/ecap/MessageRep.cc
src/adaptation/ecap/MessageRep.h
src/adaptation/ecap/ServiceRep.h
src/adaptation/ecap/XactionRep.cc
src/adaptation/ecap/XactionRep.h
src/adaptation/icap/Client.h
src/adaptation/icap/Config.h
src/adaptation/icap/Elements.cc
src/adaptation/icap/Elements.h
src/adaptation/icap/History.cc
src/adaptation/icap/History.h
src/adaptation/icap/InOut.h
src/adaptation/icap/Launcher.cc
src/adaptation/icap/Launcher.h
src/adaptation/icap/ModXact.cc
src/adaptation/icap/ModXact.h
src/adaptation/icap/OptXact.h
src/adaptation/icap/Options.h
src/adaptation/icap/ServiceRep.cc
src/adaptation/icap/ServiceRep.h
src/adaptation/icap/Xaction.cc
src/adaptation/icap/Xaction.h
src/adaptation/icap/icap_log.cc
src/auth/negotiate/auth_negotiate.cc
src/auth/ntlm/auth_ntlm.cc
src/cache_cf.cc
src/client_side.cc
src/client_side.h
src/client_side_reply.cc
src/client_side_request.cc
src/client_side_request.h
src/comm.cc
src/err_type.h
src/errorpage.cc
src/esi/VarState.cc
src/fqdncache.cc
src/ftp.cc
src/globals.h
src/helper.cc
src/http.cc
src/ip/IpAddress.cc
src/ipcache.cc
src/main.cc
src/protos.h
src/snmp_core.cc
src/stat.cc
src/store.cc
src/store_client.cc
src/structs.h
src/tests/stub_store.cc
src/wccp2.cc
test-suite/hash.h
test-suite/tcp-banger2.c
tools/cachemgr.cc
tools/squidclient.cc

index 83ce111349510c2918c5cea954eab1b44cdd510b..1e966528554eba01b8d79606021620bca371b0f3 100644 (file)
@@ -208,7 +208,7 @@ RFCNB_Print_Hex(FILE * fd, struct RFCNB_Pkt *pkt, int Offset, int Len)
 /* Get a packet of size n */
 
 struct RFCNB_Pkt *
-            RFCNB_Alloc_Pkt(int n) {
+RFCNB_Alloc_Pkt(int n) {
     RFCNB_Pkt *pkt;
 
     if ((pkt = malloc(sizeof(struct RFCNB_Pkt))) == NULL) {
index a80ef336770bb8a1db58dc8ebf9ca3221fc95bdf..5823db96e0fb7818f25f3a16236f9908631867f3 100644 (file)
@@ -188,7 +188,7 @@ char *md5sum(const char *s)
     SquidMD5Update(&ctx,(const unsigned char *)s,strlen(s));
     SquidMD5Final(digest,&ctx);
 
-    for (idx=0;idx<16;idx++)
+    for (idx=0; idx<16; idx++)
         sprintf(&sum[idx*2],"%02x",digest[idx]);
 
     sum[32]='\0';
index 6e0e08e0390397efee8c8d64b7600bda8a490fe6..4388dcc96e9740f53c893869fe91840444ec3ea8 100644 (file)
@@ -121,7 +121,7 @@ static u_int32_t ipstr2long(char *ip_str)
     int        cur_byte;
 
     ipaddr = (u_int32_t)0;
-    for (i = 0;i < 4;i++) {
+    for (i = 0; i < 4; i++) {
         ptr = buf;
         count = 0;
         *ptr = '\0';
index 428ad527a0fcf7677403acdabc8c86ddb83a27e3..287291ceaff993915a01e4698d2d58e3e2c70729 100644 (file)
@@ -42,7 +42,7 @@
  * It returns a pointer to the first entry of the linked list
  */
 struct ip_user_dict *
-            load_dict (FILE * FH) {
+load_dict (FILE * FH) {
     struct ip_user_dict *current_entry;        /* the structure used to
                                           store data */
     struct ip_user_dict *first_entry = NULL;   /* the head of the
index 3c1574bc05310c225e90564d596de8b20bae2e0d..39dda275732eeb94ca3bf39143264ca0eedc6cd1 100644 (file)
@@ -42,7 +42,7 @@ void ska_base64_decode(char* result, const char *data, int result_size)
         ska_base64_init();
     val = c = 0;
 
-    for (j = 0; *data ;data++) {
+    for (j = 0; *data ; data++) {
         unsigned int k = ((unsigned char) *data) % BASE64_VALUE_SZ;
         if (base64_value[k] < 0)
             continue;
@@ -144,7 +144,7 @@ int ska_base64_decode_len(const char *data)
     int i,j;
 
     j=0;
-    for (i=strlen(data)-1;i>=0;i--) {
+    for (i=strlen(data)-1; i>=0; i--) {
         if (data[i] == '=') j++;
         if (data[i] != '=') break;
     }
index 6bbdad2b29f6d62f971f68099a2f4af72b73c009..bb3ad8f53ac2cffc0c7950ac48ccb7e21ce0f4c5 100644 (file)
@@ -26,8 +26,7 @@
 
 // C++ Specific
 #if defined(__cplusplus)
-extern "C"
-{
+extern "C" {
 #endif
 
     /* Identifier Types */
index 3c2c9dc194cb720bc20be0166edda6b17960eeeb..b6c57f34f6aaa11da42c0c864125a70bbc4c6940 100644 (file)
@@ -27,8 +27,7 @@
 
 // C++ Specific
 #if defined(__cplusplus)
-extern "C"
-{
+extern "C" {
 #endif
 
 // Type Definitions
index f000abf1ddf6d9b2990528f681974c0bbe0ea703..c41d712d5f430439069af284b416780ab83c1c65 100644 (file)
@@ -11,8 +11,7 @@
 #define SPNEGOHELP_H
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
 #include <stddef.h>
@@ -29,9 +28,9 @@ extern "C"
      */
 
     int makeNegTokenTarg (const unsigned char *  kerberosToken,
-                          size_t                 kerberosTokenLength,
-                          const unsigned char ** negTokenTarg,
-                          size_t *               negTokenTargLength);
+    size_t                 kerberosTokenLength,
+    const unsigned char ** negTokenTarg,
+    size_t *               negTokenTargLength);
 
     /* -----------------------------------------------------------------------------
      * parseNegTokenInit parses an RFC 2478 SPNEGO NegTokenInit (token) to extract
index 44c456bd214b23e3793a67f5c438bdb3088459fa..9308c1f8a9f0abb9f32752d8417ac461d381a016 100644 (file)
@@ -26,8 +26,7 @@
 
 // C++ Specific
 #if defined(__cplusplus)
-extern "C"
-{
+extern "C" {
 #endif
 
 // Indicates if we copy data when creating a SPNEGO_TOKEN structure or not
index 414da7709f03896f579fa0b0d2b8ab8de0dc6c9e..1fd06da4a47bcca8f96b8ccd301d4f8550041893 100644 (file)
@@ -511,10 +511,10 @@ int main(int argc, char * const argv[])
                 goto cleanup;
             user=xmalloc(output_token.length+1);
             if (user == NULL) {
-               if (debug)
-                  fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), PROGRAM);
-               fprintf(stdout, "BH Not enough memory\n");
-               goto cleanup;
+                if (debug)
+                    fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), PROGRAM);
+                fprintf(stdout, "BH Not enough memory\n");
+                goto cleanup;
             }
             memcpy(user,output_token.value,output_token.length);
             user[output_token.length]='\0';
@@ -544,10 +544,10 @@ int main(int argc, char * const argv[])
              */
             user=xmalloc(output_token.length+1);
             if (user == NULL) {
-               if (debug)
-                  fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), PROGRAM);
-               fprintf(stdout, "BH Not enough memory\n");
-               goto cleanup;
+                if (debug)
+                    fprintf(stderr, "%s| %s: Not enough memory\n", LogTime(), PROGRAM);
+                fprintf(stdout, "BH Not enough memory\n");
+                goto cleanup;
             }
             memcpy(user,output_token.value,output_token.length);
             user[output_token.length]='\0';
index d002e2b03fdec85b7d438127aa33ce298020a846..396a23e21a279bbc6d40f417569937d2255769bf 100644 (file)
@@ -131,21 +131,21 @@ debug(char *format,...)
 #if FAIL_DEBUG
     if (debug_enabled || fail_debug_enabled) {
 #else
-        if (debug_enabled) {
+if (debug_enabled) {
 #endif
-            va_list args;
+        va_list args;
 
-            va_start(args, format);
-            fprintf(stderr, "ntlm-auth[%ld]: ", (long)getpid());
-            vfprintf(stderr, format, args);
-            va_end(args);
+        va_start(args, format);
+        fprintf(stderr, "ntlm-auth[%ld]: ", (long)getpid());
+        vfprintf(stderr, format, args);
+        va_end(args);
 #if FAIL_DEBUG
-            fail_debug_enabled = 0;
+        fail_debug_enabled = 0;
 #endif
-        }
+    }
 #endif /* _SQUID_MSWIN_ */
 #endif /* DEBUG */
-    }
+}
 #endif /* __GNUC__ */
 
 
index ae289797e2f31c8f636a9fa418e6f27bb3bee17a..1d3fded4f363e4ad10ca6ea16e7aa474093eae07 100644 (file)
@@ -340,7 +340,7 @@ void hex_dump(void *data, int size)
         char addrstr[10] = {0};
         char hexstr[ 16*3 + 5] = {0};
         char charstr[16*1 + 5] = {0};
-        for (n=1;n<=size;n++) {
+        for (n=1; n<=size; n++) {
             if (n%16 == 1) {
                 /* store address for this line */
                 snprintf(addrstr, sizeof(addrstr), "%.4x",
index 470d856a7d7260fcde67f5c46118360e6b1167ac..6433ab4793c49297a7aea4a417d857fee7c18a41 100644 (file)
@@ -68,21 +68,21 @@ debug(char *format,...)
 #if FAIL_DEBUG
     if (debug_enabled || fail_debug_enabled) {
 #else
-        if (debug_enabled) {
+if (debug_enabled) {
 #endif
-            va_list args;
+        va_list args;
 
-            va_start(args,format);
-            fprintf(stderr, "ntlm-auth[%d]: ",getpid());
-            vfprintf(stderr, format, args);
-            va_end(args);
+        va_start(args,format);
+        fprintf(stderr, "ntlm-auth[%d]: ",getpid());
+        vfprintf(stderr, format, args);
+        va_end(args);
 #if FAIL_DEBUG
-            fail_debug_enabled = 0;
+        fail_debug_enabled = 0;
 #endif
-        }
+    }
 #endif /* _SQUID_MSWIN_ */
 #endif /* DEBUG */
-    }
+}
 #endif /* __GNUC__ */
 
 
index 03ebf74f66fab86b142d9b0094d335b98b6d0343..e12b36fc0aa1daa61caf6e4129c0c03d673d7453 100644 (file)
@@ -186,7 +186,7 @@ RFCNB_Print_Hex(FILE * fd, struct RFCNB_Pkt *pkt, int Offset, int Len)
 /* Get a packet of size n */
 
 struct RFCNB_Pkt *
-            RFCNB_Alloc_Pkt(int n) {
+RFCNB_Alloc_Pkt(int n) {
     RFCNB_Pkt *pkt;
 
     if ((pkt = (struct RFCNB_Pkt *) malloc(sizeof(struct RFCNB_Pkt))) == NULL) {
index b801e1d780544156385d1f3bacba56a3d4c887a4..f54f9a6566285cb3dc4a3bc39856d1056f996786 100644 (file)
@@ -638,7 +638,7 @@ extern int SMBlib_SMB_Error;        /* last Error             */
 #endif
 
 extern SMB_Tree_Handle SMB_TreeConnect(SMB_Handle_Type con, SMB_Tree_Handle tree,
-                                           char *path, char *password, char const *dev);
+                                       char *path, char *password, char const *dev);
 
 extern int SMB_Init(void);
 extern void SMB_Get_My_Name(char *name, int len);
@@ -646,7 +646,7 @@ extern int SMB_Negotiate(SMB_Handle_Type Con_Handle, char const *Prots[]);
 extern int SMB_Discon(SMB_Handle_Type Con_Handle, BOOL KeepHandle);
 
 extern int SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName,
-                                char *PassWord, char *UserDomain, int precrypted);
+                            char *PassWord, char *UserDomain, int precrypted);
 
 extern int SMB_Get_Error_Msg(int msg, char *msgbuf, int len);
 
index 295c93b591364cbae12954a2bfbcf298dc60ad6e..9dd0684b8668a4cee6be223c0f64283cb9fcd974 100644 (file)
@@ -69,8 +69,7 @@ typedef u_char oid;
 #define IS_EXTENSION_ID(byte)  (((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     u_char *asn_build_header(u_char *, int *, u_char, int);
index 9ca5f0e5a110f7801e79e6b6ca04226276a0625b..21f54c83637524d242582a0ecd2afdac053d6aab 100644 (file)
@@ -67,8 +67,7 @@ struct snmp_mib_tree {
 #define TYPE_NULL          10
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     void init_mib(char *);
index 9217e626f006e7ff26734a917d5ebbf82aa839a4..497078ce062c608417b222ba9df57ca6bee928c7 100644 (file)
@@ -113,34 +113,31 @@ struct squid_radix_node_head {
     int rnh_pktsize;           /* permit, but not require fixed keys */
 
     struct squid_radix_node *(*rnh_addaddr)    /* add based on sockaddr */
-                (void *v, void *mask,
-
-                 struct squid_radix_node_head * head, struct squid_radix_node nodes[]);
+    (void *v, void *mask, struct squid_radix_node_head * head, struct squid_radix_node nodes[]);
 
     struct squid_radix_node *(*rnh_addpkt)     /* add based on packet hdr */
-                (void *v, void *mask,
-
-                 struct squid_radix_node_head * head, struct squid_radix_node nodes[]);
+    (void *v, void *mask, struct squid_radix_node_head * head, struct squid_radix_node nodes[]);
 
     struct squid_radix_node *(*rnh_deladdr)    /* remove based on sockaddr */
 
-                (void *v, void *mask, struct squid_radix_node_head * head);
+    (void *v, void *mask, struct squid_radix_node_head * head);
 
     struct squid_radix_node *(*rnh_delpkt)     /* remove based on packet hdr */
 
-                (void *v, void *mask, struct squid_radix_node_head * head);
+    (void *v, void *mask, struct squid_radix_node_head * head);
 
     struct squid_radix_node *(*rnh_matchaddr)          /* locate based on sockaddr */
 
-                (void *v, struct squid_radix_node_head * head);
+    (void *v, struct squid_radix_node_head * head);
 
     struct squid_radix_node *(*rnh_lookup)     /* locate based on sockaddr */
 
-                (void *v, void *mask, struct squid_radix_node_head * head);
+    (void *v, void *mask, struct squid_radix_node_head * head);
 
     struct squid_radix_node *(*rnh_matchpkt)   /* locate based on packet hdr */
 
-                (void *v, struct squid_radix_node_head * head);
+    (void *v, struct squid_radix_node_head * head);
+
     int (*rnh_walktree)                /* traverse tree */
 
     (struct squid_radix_node_head * head, int (*f) (struct squid_radix_node *, void *), void *w);
index 8d4f17df50958490fa61181b78cd3ef7408ad4b4..7614c4fd0698ece052919d70657e0e7212ca1f5c 100644 (file)
@@ -52,22 +52,19 @@ SOFTWARE.
 #define SNMP_DEFAULT_MACREPEATERS   0
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     /* Parse the buffer pointed to by arg3, of length arg4, into pdu arg2.
      *
      * Returns the community of the incoming PDU, or NULL
      */
-    u_char *snmp_parse(struct snmp_session *, struct snmp_pdu *,
-                       u_char *, int);
+    u_char *snmp_parse(struct snmp_session *, struct snmp_pdu *, u_char *, int);
 
     /* Encode pdu arg2 into buffer arg3.  arg4 contains the size of
      * the buffer.
      */
-    int snmp_build(struct snmp_session *, struct snmp_pdu *,
-                   u_char *, int *);
+    int snmp_build(struct snmp_session *, struct snmp_pdu *, u_char *, int *);
 
     /*
      * struct snmp_session *snmp_open(session)
index 69c6d2632e6cc1a52288b85ab3426ea1bb5bc1a9..2fe33f81c1dd258c520a8f0e2cb79d627d57db5d 100644 (file)
@@ -52,8 +52,7 @@
 #define SNMPERR_LAST            -16    /* Last error message */
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     /* extern int snmp_errno */
index 7a8090a884adeea4b1987de9ef9a0c7448eb92e8..52b745129eeec2f7311e7fc70bb73fe85a93f610 100644 (file)
@@ -85,8 +85,7 @@ struct snmp_internal_session {
 #endif /* HAVE_SRAND */
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     int snmp_get_socket_session(struct snmp_session *session_);
index b1f439b98674069c96a57ddea3bd2f401fc9494f..69b7b32e2dfe7b711ebacd86d1dbe6a0f16d64fb 100644 (file)
@@ -41,8 +41,7 @@ struct synch_state {
 };
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     extern struct synch_state snmp_synch_state;
index 71a48ce386a18753bc581bacac9856d6c73ff5e8..75d19f195deca345c25c68fec3d4c0383b90f818 100644 (file)
@@ -31,8 +31,7 @@
  **********************************************************************/
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     int snmp_coexist_V2toV1(struct snmp_pdu *);
index c3478110e888147c286079ba20c06eb80217006b..1235825bb91d63df8aa65df94fc682eccc4de7f9 100644 (file)
@@ -57,8 +57,7 @@
 
 #ifdef __cplusplus
 
-extern "C"
-{
+extern "C" {
 #endif
 
     const char *snmp_errstring(int);
index 8135b8b09842e7a66b57fe6f97e60bf39024af77..b2ba6a783a5817c9990967f4dec7e195e75f9f3b 100644 (file)
@@ -36,8 +36,7 @@
 #define SNMP_VERSION_2     1   /* RFC 1901 */
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     u_char *snmp_msg_Encode(u_char *, int *, u_char *, int, int, struct snmp_pdu *);
index f2f565f9fce08bad443d4965adbfb264eb0ce3af..c5b2179e17e83cceaa53caf2e80c21425a3d909a 100644 (file)
@@ -39,8 +39,7 @@
  **********************************************************************/
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     typedef struct sockaddr_in ipaddr;
index 32901f48ced204d6f9345db94809a17c10dd8603..c733420b8c2c1a979ffeddd7d30b6b4a81912c73 100644 (file)
@@ -7,8 +7,7 @@
 #include "config.h"
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     /* call a function at regular intervals (in seconds): */
index 69ca1f9adf4bea0fed110c7683b5093df91cb73e..020919f09bcc7f28665c5e836786a4aa0af7ffe6 100644 (file)
@@ -32,8 +32,7 @@
 #include "asn1.h"
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
     struct variable_list {
index 1f575facf55d56f09ce1ff7b14ba0d959b6ccaae..e5516e36296b5ec9058fcc1add198e268c3ad5f1 100644 (file)
@@ -155,7 +155,7 @@ opendir(const CHAR * szPath)
  * next entry in the directory.
  */
 struct dirent *
-            readdir(DIR * dirp) {
+readdir(DIR * dirp) {
     errno = 0;
 
     /* Check for valid DIR struct. */
index becb57b0e8d6ccd58e68745039d3576fa6c5e9a6..25917df2afe1521a9e55cfe85eb9468894507ab8 100644 (file)
@@ -83,7 +83,7 @@
 #include "inet_pton.h"
 
 static struct addrinfo *
-            dup_addrinfo (struct addrinfo *info, void *addr, size_t addrlen) {
+dup_addrinfo (struct addrinfo *info, void *addr, size_t addrlen) {
     struct addrinfo *ret;
 
     ret = malloc (sizeof (struct addrinfo));
index 8e4edb0019cc2d5d021874b0ec04e4c52d68d71b..94f81f832cfd1f2605f242d443a26adc424318ec 100644 (file)
@@ -178,7 +178,7 @@ static char *rn_zeros, *rn_ones;
  */
 
 struct squid_radix_node *
-            squid_rn_search(void *v_arg, struct squid_radix_node *head) {
+squid_rn_search(void *v_arg, struct squid_radix_node *head) {
     register struct squid_radix_node *x;
     register caddr_t v;
 
@@ -192,7 +192,7 @@ struct squid_radix_node *
 }
 
 struct squid_radix_node *
-            squid_rn_search_m(void *v_arg, struct squid_radix_node *head, void *m_arg) {
+squid_rn_search_m(void *v_arg, struct squid_radix_node *head, void *m_arg) {
     register struct squid_radix_node *x;
     register caddr_t v = v_arg, m = m_arg;
 
@@ -233,7 +233,7 @@ squid_rn_refines(void *m_arg, void *n_arg)
 }
 
 struct squid_radix_node *
-            squid_rn_lookup(void *v_arg, void *m_arg, struct squid_radix_node_head *head) {
+squid_rn_lookup(void *v_arg, void *m_arg, struct squid_radix_node_head *head) {
     register struct squid_radix_node *x;
     caddr_t netmask = 0;
 
@@ -271,7 +271,7 @@ rn_satsifies_leaf(char *trial, register struct squid_radix_node *leaf, int skip)
 }
 
 struct squid_radix_node *
-            squid_rn_match(void *v_arg, struct squid_radix_node_head *head) {
+squid_rn_match(void *v_arg, struct squid_radix_node_head *head) {
     caddr_t v = v_arg;
     register struct squid_radix_node *t = head->rnh_treetop, *x;
     register caddr_t cp = v, cp2;
@@ -377,7 +377,7 @@ int rn_debug = 1;
 #endif
 
 struct squid_radix_node *
-            squid_rn_newpair(void *v, int b, struct squid_radix_node nodes[2]) {
+squid_rn_newpair(void *v, int b, struct squid_radix_node nodes[2]) {
     register struct squid_radix_node *tt = nodes, *t = tt + 1;
     t->rn_b = b;
     t->rn_bmask = 0x80 >> (b & 7);
@@ -398,7 +398,7 @@ struct squid_radix_node *
 }
 
 struct squid_radix_node *
-            squid_rn_insert(void *v_arg, struct squid_radix_node_head *head, int *dupentry, struct squid_radix_node nodes[2]) {
+squid_rn_insert(void *v_arg, struct squid_radix_node_head *head, int *dupentry, struct squid_radix_node nodes[2]) {
     caddr_t v = v_arg;
     struct squid_radix_node *top = head->rnh_treetop;
     int head_off = top->rn_off, vlen = (int) *((u_char *) v);
@@ -463,7 +463,7 @@ on1:
 }
 
 struct squid_radix_node *
-            squid_rn_addmask(void *n_arg, int search, int skip) {
+squid_rn_addmask(void *n_arg, int search, int skip) {
     caddr_t netmask = (caddr_t) n_arg;
     register struct squid_radix_node *x;
     register caddr_t cp, cplim;
@@ -548,7 +548,7 @@ rn_lexobetter(void *m_arg, void *n_arg)
 }
 
 static struct squid_radix_mask *
-            rn_new_radix_mask(struct squid_radix_node *tt, struct squid_radix_mask *next) {
+rn_new_radix_mask(struct squid_radix_node *tt, struct squid_radix_mask *next) {
     register struct squid_radix_mask *m;
 
     squid_MKGet(m);
@@ -569,7 +569,7 @@ static struct squid_radix_mask *
 }
 
 struct squid_radix_node *
-            squid_rn_addroute(void *v_arg, void *n_arg, struct squid_radix_node_head *head, struct squid_radix_node treenodes[2]) {
+squid_rn_addroute(void *v_arg, void *n_arg, struct squid_radix_node_head *head, struct squid_radix_node treenodes[2]) {
     caddr_t v = (caddr_t) v_arg, netmask = (caddr_t) n_arg;
     register struct squid_radix_node *t, *x = NULL, *tt;
     struct squid_radix_node *saved_tt, *top = head->rnh_treetop;
@@ -720,7 +720,7 @@ on2:
 }
 
 struct squid_radix_node *
-            squid_rn_delete(void *v_arg, void *netmask_arg, struct squid_radix_node_head *head) {
+squid_rn_delete(void *v_arg, void *netmask_arg, struct squid_radix_node_head *head) {
     register struct squid_radix_node *t, *p, *x, *tt;
     struct squid_radix_mask *m, *saved_m, **mp;
     struct squid_radix_node *dupedkey, *saved_tt, *top;
index 5797646f9caf0fe183e155b769787b76be6565e2..9bd85a8bc617636218d03473c955bf4f4dfd00a3 100644 (file)
@@ -118,8 +118,8 @@ tmSaneValues(struct tm *tm)
 }
 
 static struct tm *
-            parse_date_elements(const char *day, const char *month, const char *year,
-                                const char *time, const char *zone) {
+parse_date_elements(const char *day, const char *month, const char *year,
+                    const char *time, const char *zone) {
     static struct tm tm;
     char *t;
     memset(&tm, 0, sizeof(tm));
@@ -150,7 +150,7 @@ static struct tm *
 }
 
 static struct tm *
-            parse_date(const char *str) {
+parse_date(const char *str) {
     struct tm *tm;
     static char tmp[64];
     char *t;
@@ -224,7 +224,7 @@ parse_rfc1123(const char *str)
 #elif defined(_SQUID_MSWIN_)
 #elif defined(_SQUID_SGI_)
 #else
-        extern long timezone;
+    extern long timezone;
 #endif
         /*
          * The following assumes a fixed DST offset of 1 hour,
@@ -235,7 +235,7 @@ parse_rfc1123(const char *str)
 #if defined ( _timezone) || defined(_SQUID_WIN32_)
         t -= (_timezone + dst);
 #else
-        t -= (timezone + dst);
+    t -= (timezone + dst);
 #endif
     }
 #endif
index ea7595e6cc1e1b1e6060fc72b9babf0a3c4ddfb0..55526e5e61f3766ca25aedd6119945340c076f66 100644 (file)
@@ -490,13 +490,13 @@ wsastrerror(int err)
 }
 
 struct passwd *
-            getpwnam(char *unused) {
+getpwnam(char *unused) {
     static struct passwd pwd = {NULL, NULL, 100, 100, NULL, NULL, NULL};
     return &pwd;
 }
 
 struct group *
-            getgrnam(char *unused) {
+getgrnam(char *unused) {
     static struct group grp = {NULL, NULL, 100, NULL};
     return &grp;
 }
index 160e4a22bbc4b2ab6a4f6107234dde6296f2086a..f4b1337975a077c5584823ff3839df33564988e0 100644 (file)
@@ -100,7 +100,7 @@ init_mib(char *file)
 
 
 static struct snmp_mib_tree *
-            find_rfc1066_mib(struct snmp_mib_tree *root) {
+find_rfc1066_mib(struct snmp_mib_tree *root) {
     oid *op = RFC1066_MIB;
     struct snmp_mib_tree *tp;
     int len;
@@ -283,8 +283,8 @@ int objidlen;               /* number of subidentifiers */
 }
 
 static struct snmp_mib_tree *
-            get_symbol(objid, objidlen, subtree, buf)
-            oid *objid;
+get_symbol(objid, objidlen, subtree, buf)
+oid *objid;
 int objidlen;
 struct snmp_mib_tree *subtree;
 char *buf;
index 69335fa1b23ee4c28b6b92935cde2630ca485d95..517b01d2ad6c2b89f0b9fec585b592501f0e3461 100644 (file)
@@ -428,7 +428,7 @@ do_subtree(struct snmp_mib_tree *root, struct node **nodes)
 static
 #endif
 struct snmp_mib_tree *
-            build_tree(struct node *nodes) {
+build_tree(struct node *nodes) {
     struct node *np;
     struct snmp_mib_tree *tp;
     int bucket, nodes_left = 0;
@@ -635,7 +635,7 @@ free_node(struct node *np)
  * Returns 0 on error.
  */
 static struct node *
-            parse_objectid(FILE *fp, char *name) {
+parse_objectid(FILE *fp, char *name) {
     int type;
     char token[64];
     register int count;
@@ -744,7 +744,7 @@ parse_asntype(FILE *fp)
  * Returns 0 on error.
  */
 static struct node *
-            parse_objecttype(register FILE *fp, char *name) {
+parse_objecttype(register FILE *fp, char *name) {
     register int type;
     char token[64];
     int count, length;
@@ -978,7 +978,7 @@ static struct node *
 static
 #endif
 struct node *
-            parse(FILE *fp) {
+parse(FILE *fp) {
     char token[64];
     char name[64];
     int type = 1;
@@ -1062,7 +1062,7 @@ struct node *
 }
 
 struct snmp_mib_tree *
-            read_mib(char *filename) {
+read_mib(char *filename) {
     FILE *fp;
     struct node *nodes;
     struct snmp_mib_tree *tree;
index 84aa88d2cefcdcbf7f754adf31ac9cabaf9fed90..a52ba24a7745ff9a373ce0d0e9c3ad36031d78c4 100644 (file)
  */
 
 struct snmp_pdu *
-            snmp_pdu_create(int command) {
+snmp_pdu_create(int command) {
     struct snmp_pdu *pdu;
 
 #ifdef DEBUG_PDU
@@ -138,7 +138,7 @@ struct snmp_pdu *
 /* Clone an existing PDU.
  */
 struct snmp_pdu *
-            snmp_pdu_clone(struct snmp_pdu *Src) {
+snmp_pdu_clone(struct snmp_pdu *Src) {
     struct snmp_pdu *Dest;
 
 #ifdef DEBUG_PDU
@@ -172,12 +172,12 @@ struct snmp_pdu *
  * be returned.
  */
 struct snmp_pdu *
-            snmp_pdu_fix(struct snmp_pdu *pdu, int command) {
+snmp_pdu_fix(struct snmp_pdu *pdu, int command) {
     return (snmp_fix_pdu(pdu, command));
 }
 
 struct snmp_pdu *
-            snmp_fix_pdu(struct snmp_pdu *pdu, int command) {
+snmp_fix_pdu(struct snmp_pdu *pdu, int command) {
     struct variable_list *var, *newvar;
     struct snmp_pdu *newpdu;
     int i;
index f781e1e6c2309ee2a47f4f4f87e6113a54f4c705..0c89ee26ed26572bf9a4c4c46e7bb35233fdf872 100644 (file)
  */
 
 struct variable_list *
-            snmp_var_new(oid * Name, int Len) {
+snmp_var_new(oid * Name, int Len) {
     struct variable_list *New;
 
 #ifdef DEBUG_VARS
@@ -147,7 +147,7 @@ struct variable_list *
 }
 
 struct variable_list *
-            snmp_var_new_integer(oid * Name, int Len, int ival, unsigned char type) {
+snmp_var_new_integer(oid * Name, int Len, int ival, unsigned char type) {
     variable_list *v = snmp_var_new(Name, Len);
     v->val_len = sizeof(int);
     v->val.integer = xmalloc(sizeof(int));
@@ -162,7 +162,7 @@ struct variable_list *
  */
 
 struct variable_list *
-            snmp_var_clone(struct variable_list *Src) {
+snmp_var_clone(struct variable_list *Src) {
     struct variable_list *Dest;
 
 #ifdef DEBUG_VARS
index d9cdb8acb245fa5a217ebaa3b6d4fc2e82991de4..8e398ccbdf01d1da9d5adbc270537c2a6eac5d70 100644 (file)
@@ -12,7 +12,7 @@
 void (*snmplib_debug_hook) (int, char *,...) = NULL;
 
 extern void
-    snmplib_debug(int lvl, const char *fmt,...)
+snmplib_debug(int lvl, const char *fmt,...)
 {
     char buf[BUFSIZ];
     va_list args;
index 868c1b27d0acbaee44fc3bae2baffd1ad78cd29b..9410ba25880554210c8149a251de4e3e1780382f 100644 (file)
@@ -127,9 +127,9 @@ public:
     public:
         Headers() : request(NULL),
 #if ICAP_CLIENT
-                    icap(NULL),
+                icap(NULL),
 #endif
-                    reply(NULL) {}
+                reply(NULL) {}
 
         char *request;
 
@@ -157,9 +157,10 @@ public:
     /** \brief This subclass holds log info for ICAP part of request
      *  \todo Inner class declarations should be moved outside
      */
-    class IcapLogEntry {
+    class IcapLogEntry
+    {
     public:
-    IcapLogEntry():request(NULL),reply(NULL),outcome(Adaptation::Icap::xoUnknown),trTime(0),ioTime(0),resStatus(HTTP_STATUS_NONE){}
+        IcapLogEntry():request(NULL),reply(NULL),outcome(Adaptation::Icap::xoUnknown),trTime(0),ioTime(0),resStatus(HTTP_STATUS_NONE) {}
 
         IpAddress hostAddr; ///< ICAP server IP address
         String serviceName;        ///< ICAP service name
@@ -178,7 +179,7 @@ public:
         int trTime;
         /** \brief Transaction I/O time.
          * The timer starts when the first ICAP request
-         * byte is scheduled for sending and stops when the lastbyte of the 
+         * byte is scheduled for sending and stops when the lastbyte of the
          * ICAP response is received.
          */
         int ioTime;
index 0cae9446c1436359dda6bbc1121e6f2f4d6e30d1..501f17b52b42ecf64df9172463f79c101b0ef7f2 100644 (file)
@@ -189,9 +189,8 @@ BodyPipe::clearProducer(bool atEof)
         if (atEof) {
             if (!bodySizeKnown())
                 theBodySize = thePutSize;
-            else
-                if (bodySize() != thePutSize)
-                    debugs(91,3, HERE << "aborting on premature eof" << status());
+            else if (bodySize() != thePutSize)
+                debugs(91,3, HERE << "aborting on premature eof" << status());
         } else {
             // asserta that we can detect the abort if the consumer joins later
             assert(!bodySizeKnown() || bodySize() != thePutSize);
@@ -321,9 +320,8 @@ BodyPipe::checkIn(Checkout &checkout)
     const size_t currentSize = theBuf.contentSize();
     if (checkout.checkedOutSize > currentSize)
         postConsume(checkout.checkedOutSize - currentSize);
-    else
-        if (checkout.checkedOutSize < currentSize)
-            postAppend(currentSize - checkout.checkedOutSize);
+    else if (checkout.checkedOutSize < currentSize)
+        postAppend(currentSize - checkout.checkedOutSize);
 }
 
 void
index ebd2bd781fee7d8d0003213595e6c0e092a922a6..1c17263577cc0e96ea926325deaf56331374e098 100644 (file)
@@ -192,17 +192,15 @@ bool ChunkedCodingParser::findCrlf(size_t &crlfBeg, size_t &crlfEnd)
         if (quoted) {
             if (c == '\\')
                 slashed = true;
-            else
-                if (c == '"')
-                    quoted = false;
+            else if (c == '"')
+                quoted = false;
 
             continue;
-        } else
-            if (c == '"') {
-                quoted = true;
-                crOff = -1;
-                continue;
-            }
+        } else if (c == '"') {
+            quoted = true;
+            crOff = -1;
+            continue;
+        }
 
         if (crOff < 0) { // looking for the first CR or LF
 
index a670380c445adfde4c4faf02a0bdc1c34455178b..d07cbd9e2472c8c3c7fb99a282b7844f410eac70 100644 (file)
@@ -172,7 +172,7 @@ protected:
 
 // accept (IOACB) dialer
 class CommAcceptCbPtrFun: public CallDialer,
-            public CommDialerParamsT<CommAcceptCbParams>
+        public CommDialerParamsT<CommAcceptCbParams>
 {
 public:
     typedef CommAcceptCbParams Params;
@@ -188,7 +188,7 @@ public:
 
 // connect (CNCB) dialer
 class CommConnectCbPtrFun: public CallDialer,
-            public CommDialerParamsT<CommConnectCbParams>
+        public CommDialerParamsT<CommConnectCbParams>
 {
 public:
     typedef CommConnectCbParams Params;
@@ -205,7 +205,7 @@ public:
 
 // read/write (IOCB) dialer
 class CommIoCbPtrFun: public CallDialer,
-            public CommDialerParamsT<CommIoCbParams>
+        public CommDialerParamsT<CommIoCbParams>
 {
 public:
     typedef CommIoCbParams Params;
@@ -222,7 +222,7 @@ public:
 
 // close (PF) dialer
 class CommCloseCbPtrFun: public CallDialer,
-            public CommDialerParamsT<CommCloseCbParams>
+        public CommDialerParamsT<CommCloseCbParams>
 {
 public:
     typedef CommCloseCbParams Params;
@@ -237,7 +237,7 @@ public:
 };
 
 class CommTimeoutCbPtrFun:public CallDialer,
-            public CommDialerParamsT<CommTimeoutCbParams>
+        public CommDialerParamsT<CommTimeoutCbParams>
 {
 public:
     typedef CommTimeoutCbParams Params;
index 4080c64ff1f552fe7619467bcb2ea3c40ad35b73..8f1f061cf6060da86c19bcb6fa789f156d1a624b 100644 (file)
@@ -10,7 +10,7 @@ DnsLookupDetails::DnsLookupDetails(): wait(-1)
 }
 
 DnsLookupDetails::DnsLookupDetails(const String &e, int w):
-    error(e), wait(w)
+        error(e), wait(w)
 {
 }
 
index 9284c69955aba2e59203b8a48cad97cf8189b06a..3fc6a8019d035a93167ffc05e77d0a7bd68b9936 100644 (file)
@@ -58,7 +58,7 @@ public:
     struct timeval peer_select_start;
 
     struct timeval store_complete_stop;
-    
+
     http_status peer_reply_status; ///< last HTTP status code received
     timeval peer_http_request_sent; ///< last peer finished writing req
     int64_t peer_response_time; ///< last peer response delay
index dbe3472154ba77f45e8fc3241c02bd547138792b..e0fba7b6860a9be28af0eea0032b8c89c5d1fe86 100644 (file)
@@ -321,7 +321,7 @@ httpHeaderInitModule(void)
     httpHeaderCalcMask(&RequestHeadersMask, EntityHeadersArr, countof(EntityHeadersArr));
 
     httpHeaderMaskInit(&HopByHopHeadersMask, 0);
-    
+
     httpHeaderCalcMask(&HopByHopHeadersMask, HopByHopHeadersArr, countof(HopByHopHeadersArr));
 
     /* init header stats */
index c598c61e4f927cc78cf7c13e727dd37fba347def..4384b3be2949a40adc3e38c8a322303edcd0f668 100644 (file)
@@ -233,8 +233,7 @@ strListGetItem(const String * str, char del, const char **item, int *ilen, const
      * processing merged header values properly, even if Cookie normally
      * uses ';' as delimiter.
      */
-    static char delim[3][8] =
-    {
+    static char delim[3][8] = {
         "\"?,",
         "\"\\",
         " ?,\t\r\n"
@@ -263,12 +262,12 @@ strListGetItem(const String * str, char del, const char **item, int *ilen, const
         if (**pos == '"') {
             quoted = !quoted;
             *pos += 1;
-       } else if (quoted && **pos == '\\') {
+        } else if (quoted && **pos == '\\') {
             *pos += 1;
             if (**pos)
                 *pos += 1;
-       } else {
-           break;              /* Delimiter found, marking the end of this value */
+        } else {
+            break;             /* Delimiter found, marking the end of this value */
         }
     } while (**pos);
 
index 13455344dbb6aadc1b5aa704d48c07f0ce336c73..c38abc0175befd011079d221fa3555d85a983fd2 100644 (file)
@@ -99,13 +99,13 @@ public:
     virtual bool inheritProperties(const HttpMsg *aMsg) = 0;
 
 protected:
-     /**
-      * Validate the message start line is syntactically correct.
-      * Set HTTP error status according to problems found.
-      *
-      * \retval true   Status line has no serious problems.
-      * \retval false  Status line has a serious problem. Correct response is indicated by error.
-      */
+    /**
+     * Validate the message start line is syntactically correct.
+     * Set HTTP error status according to problems found.
+     *
+     * \retval true   Status line has no serious problems.
+     * \retval false  Status line has a serious problem. Correct response is indicated by error.
+     */
     virtual bool sanityCheckStartLine(MemBuf *buf, const size_t hdr_len, http_status *error) = 0;
 
     virtual void packFirstLineInto(Packer * p, bool full_uri) const = 0;
@@ -119,7 +119,8 @@ protected:
 };
 
 /* Temporary parsing state; might turn into the replacement parser later on */
-class HttpParser {
+class HttpParser
+{
 public:
     char state;
     const char *buf;
index 5cb5ebe0d7de59f7a8a1c89945769666dfc8cf8a..11ed80211857e6ec3b2e7fd4f8fe0d2f5fb1dec7 100644 (file)
@@ -377,12 +377,12 @@ request_flags::clearResetTCP()
 }
 
 #if ICAP_CLIENT
-Adaptation::Icap::History::Pointer 
+Adaptation::Icap::History::Pointer
 HttpRequest::icapHistory() const
 {
     if (!icapHistory_) {
         if ((LogfileStatus == LOG_ENABLE && alLogformatHasIcapToken) ||
-            IcapLogfileStatus == LOG_ENABLE) {
+                IcapLogfileStatus == LOG_ENABLE) {
             icapHistory_ = new Adaptation::Icap::History();
             debugs(93,4, HERE << "made " << icapHistory_ << " for " << this);
         }
@@ -393,7 +393,7 @@ HttpRequest::icapHistory() const
 #endif
 
 #if USE_ADAPTATION
-Adaptation::History::Pointer 
+Adaptation::History::Pointer
 HttpRequest::adaptHistory(bool createIfNone) const
 {
     if (!adaptHistory_ && createIfNone) {
@@ -404,11 +404,11 @@ HttpRequest::adaptHistory(bool createIfNone) const
     return adaptHistory_;
 }
 
-Adaptation::History::Pointer 
+Adaptation::History::Pointer
 HttpRequest::adaptLogHistory() const
 {
     const bool loggingNeedsHistory = (LogfileStatus == LOG_ENABLE) &&
-        alLogformatHasAdaptToken; // TODO: make global to remove this method?
+                                     alLogformatHasAdaptToken; // TODO: make global to remove this method?
     return HttpRequest::adaptHistory(loggingNeedsHistory);
 }
 
index 433a28e90c0d54387e09a53cfb1ac07e7a56098f..44c53caac59d6a58dafa4268747274fc531797ac 100644 (file)
@@ -176,8 +176,8 @@ ServerStateData::serverComplete()
 
     HttpRequest *r = originalRequest();
     r->hier.total_response_time = r->hier.first_conn_start.tv_sec ?
-        tvSubMsec(r->hier.first_conn_start, current_time) : -1;
-    
+                                  tvSubMsec(r->hier.first_conn_start, current_time) : -1;
+
     if (requestBodySource != NULL)
         stopConsumingFrom(requestBodySource);
 
@@ -529,7 +529,7 @@ ServerStateData::startAdaptation(const Adaptation::ServiceGroupPointer &group, H
     }
 
     adaptedHeadSource = initiateAdaptation(
-        new Adaptation::Iterator(this, vrep, cause, group));
+                            new Adaptation::Iterator(this, vrep, cause, group));
     startedAdaptation = adaptedHeadSource != NULL;
     Must(startedAdaptation);
 }
index d1179456c7103b86d092b7df0dc56cb132e8c5d9..611f0c0930a6ef431fdbfa61587e0cc4d82f1f7f 100644 (file)
  */
 class ServerStateData:
 #if USE_ADAPTATION
-            public Adaptation::Initiator,
-            public BodyProducer,
+        public Adaptation::Initiator,
+        public BodyProducer,
 #endif
-            public BodyConsumer
+        public BodyConsumer
 {
 
 public:
index 6d4be53878a81c83fe625d53a9c051d0cb56baa9..854b4fd896bad3e9da0526a80e44669376732270 100644 (file)
@@ -207,7 +207,7 @@ public:
 
     bool isEmpty () const {return true;}
 
-    virtual size_t bytesWanted(Range<size_t> const aRange) const { assert (aRange.size());return aRange.end - 1;}
+    virtual size_t bytesWanted(Range<size_t> const aRange) const { assert (aRange.size()); return aRange.end - 1;}
 
     void operator delete(void *address);
     void complete() {}
index 03592658f7a72f110bc2124530731571bc0c9d79..bcee9943786f5d7682fb368721cea07f5674c5bd 100644 (file)
@@ -3,13 +3,13 @@
 
 TextException::TextException()
 {
-       message=NULL;
-       theFileName=NULL;
-       theLineNo=0;
+    message=NULL;
+    theFileName=NULL;
+    theLineNo=0;
 }
 
 TextException::TextException(const TextException& right) :
-       message((right.message?xstrdup(right.message):NULL)), theFileName(right.theFileName), theLineNo(right.theLineNo)
+        message((right.message?xstrdup(right.message):NULL)), theFileName(right.theFileName), theLineNo(right.theLineNo)
 {
 }
 
@@ -19,18 +19,18 @@ TextException::TextException(const char *aMsg, const char *aFileName, int aLineN
 
 TextException::~TextException() throw()
 {
-    if(message) xfree(message);
+    if (message) xfree(message);
 }
 
 TextException& TextException::operator=(const TextException &right)
 {
-       if(this==&right) return *this;
-       if(message) xfree(message);
+    if (this==&right) return *this;
+    if (message) xfree(message);
     message=(right.message?xstrdup(right.message):NULL);
     theFileName=right.theFileName;
     theLineNo=right.theLineNo;
 
-       return *this;   
+    return *this;
 }
 
 const char *TextException::what() const throw()
index 5edf33f17a7af975ab268b57e380ac7d868d0e29..59e82b42fc29a0ed387037372cd792510835b6e5 100644 (file)
@@ -20,7 +20,7 @@ public:
 
     virtual const char *what() const throw();
 
-       TextException& operator=(const TextException &right);
+    TextException& operator=(const TextException &right);
 
 public:
     char *message; // read-only
index 15e497e391cb0e606958d4df98ada72f1ac659bf..301ae8f2f80b9ecf8e40066be0363c9b1be3aeb7 100644 (file)
@@ -402,7 +402,7 @@ typedef enum {
     LTF_ADAPTATION_ALL_XACT_TIMES,
 #endif
 
-#if ICAP_CLIENT    
+#if ICAP_CLIENT
 
     LFT_ICAP_TOTAL_TIME,
     LFT_ICAP_LAST_MATCHED_HEADER,
@@ -415,15 +415,15 @@ typedef enum {
     LFT_ICAP_REQUEST_METHOD,
     LFT_ICAP_BYTES_SENT,
     LFT_ICAP_BYTES_READ,
-    
+
     LFT_ICAP_REQ_HEADER,
     LFT_ICAP_REQ_HEADER_ELEM,
     LFT_ICAP_REQ_ALL_HEADERS,
-    
+
     LFT_ICAP_REP_HEADER,
     LFT_ICAP_REP_HEADER_ELEM,
     LFT_ICAP_REP_ALL_HEADERS,
-    
+
     LFT_ICAP_TR_RESPONSE_TIME,
     LFT_ICAP_IO_TIME,
     LFT_ICAP_OUTCOME,
@@ -623,7 +623,7 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
             if (al->cache.caddr.IsAnyAddr()) // e.g., ICAP OPTIONS lack client
                 out = "-";
             else
-            out = fqdncache_gethostbyaddr(al->cache.caddr, FQDN_LOOKUP_IF_MISS);
+                out = fqdncache_gethostbyaddr(al->cache.caddr, FQDN_LOOKUP_IF_MISS);
             if (!out) {
                 out = al->cache.caddr.NtoA(tmp,1024);
             }
@@ -704,7 +704,7 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
             doint = 1;
             break;
 
-    case LFT_PEER_RESPONSE_TIME:
+        case LFT_PEER_RESPONSE_TIME:
             if (al->hier.peer_response_time < 0) {
                 out = "-";
             } else {
@@ -770,7 +770,7 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
             break;
 #endif
 
-#if ICAP_CLIENT            
+#if ICAP_CLIENT
         case LFT_ICAP_LAST_MATCHED_HEADER:
             if (al->request) {
                 Adaptation::Icap::History::Pointer ih = al->request->icapHistory();
@@ -806,7 +806,7 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
 
         case LFT_ICAP_ADDR:
             if (!out)
-        out = al->icap.hostAddr.NtoA(tmp,1024);
+                out = al->icap.hostAddr.NtoA(tmp,1024);
             break;
 
         case LFT_ICAP_SERV_NAME:
@@ -881,7 +881,7 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
 
             break;
 
-        case LFT_ICAP_REP_ALL_HEADERS: 
+        case LFT_ICAP_REP_ALL_HEADERS:
             if (al->icap.reply) {
                 HttpHeaderPos pos = HttpHeaderInitPos;
                 while (const HttpHeaderEntry *e = al->icap.reply->header.getEntry(&pos)) {
@@ -997,8 +997,8 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
             /* case LFT_USER_REALM: */
             /* case LFT_USER_SCHEME: */
 
-        // the fmt->type can not be LFT_HTTP_SENT_STATUS_CODE_OLD_30
-        // but compiler complains if ommited
+            // the fmt->type can not be LFT_HTTP_SENT_STATUS_CODE_OLD_30
+            // but compiler complains if ommited
         case LFT_HTTP_SENT_STATUS_CODE_OLD_30:
         case LFT_HTTP_SENT_STATUS_CODE:
             outint = al->http.code;
@@ -1008,10 +1008,9 @@ accessLogCustom(AccessLogEntry * al, customlog * log)
             break;
 
         case LFT_HTTP_RECEIVED_STATUS_CODE:
-            if(al->hier.peer_reply_status == HTTP_STATUS_NONE) {
+            if (al->hier.peer_reply_status == HTTP_STATUS_NONE) {
                 out = "-";
-            }
-            else {
+            } else {
                 outint = al->hier.peer_reply_status;
                 doint = 1;
             }
@@ -1317,12 +1316,12 @@ accessLogGetNewLogFormatToken(logformat_token * lt, char *def, enum log_quote *q
             cur++;
     }
 
-    // For upward compatibility, assume "http::" prefix as default prefix 
+    // For upward compatibility, assume "http::" prefix as default prefix
     // for all log access formating codes, except those starting
     // from "icap::", "adapt::" and "%"
     if (strncmp(cur,"http::", 6) == 0 &&
-        strncmp(cur+6, "icap::", 6) != 0  &&
-        strncmp(cur+6, "adapt::", 12) != 0 && *(cur+6) != '%' ) {
+            strncmp(cur+6, "icap::", 6) != 0  &&
+            strncmp(cur+6, "adapt::", 12) != 0 && *(cur+6) != '%' ) {
         cur += 6;
     }
 
@@ -1350,7 +1349,7 @@ done:
 
     switch (lt->type) {
 
-#if ICAP_CLIENT    
+#if ICAP_CLIENT
     case LFT_ICAP_LAST_MATCHED_HEADER:
 
     case LFT_ICAP_REQ_HEADER:
@@ -1376,29 +1375,51 @@ done:
 
                 lt->data.header.element = cp;
 
-                switch(lt->type) {
-                case LFT_REQUEST_HEADER: lt->type = LFT_REQUEST_HEADER_ELEM; break;
-                case LFT_REPLY_HEADER: lt->type = LFT_REPLY_HEADER_ELEM; break;
+                switch (lt->type) {
+                case LFT_REQUEST_HEADER:
+                    lt->type = LFT_REQUEST_HEADER_ELEM;
+                    break;
+                case LFT_REPLY_HEADER:
+                    lt->type = LFT_REPLY_HEADER_ELEM;
+                    break;
 #if ICAP_CLIENT
-                case LFT_ICAP_LAST_MATCHED_HEADER: lt->type = LFT_ICAP_LAST_MATCHED_HEADER_ELEM; break;
-                case LFT_ICAP_REQ_HEADER: lt->type = LFT_ICAP_REQ_HEADER_ELEM; break; 
-                case LFT_ICAP_REP_HEADER: lt->type = LFT_ICAP_REP_HEADER_ELEM; break;
+                case LFT_ICAP_LAST_MATCHED_HEADER:
+                    lt->type = LFT_ICAP_LAST_MATCHED_HEADER_ELEM;
+                    break;
+                case LFT_ICAP_REQ_HEADER:
+                    lt->type = LFT_ICAP_REQ_HEADER_ELEM;
+                    break;
+                case LFT_ICAP_REP_HEADER:
+                    lt->type = LFT_ICAP_REP_HEADER_ELEM;
+                    break;
 #endif
-                default:break;
+                default:
+                    break;
                 }
             }
 
             lt->data.header.header = header;
         } else {
-            switch(lt->type) {
-            case LFT_REQUEST_HEADER: lt->type = LFT_REQUEST_ALL_HEADERS; break;
-            case LFT_REPLY_HEADER: lt->type = LFT_REPLY_ALL_HEADERS; break;
+            switch (lt->type) {
+            case LFT_REQUEST_HEADER:
+                lt->type = LFT_REQUEST_ALL_HEADERS;
+                break;
+            case LFT_REPLY_HEADER:
+                lt->type = LFT_REPLY_ALL_HEADERS;
+                break;
 #if ICAP_CLIENT
-            case LFT_ICAP_LAST_MATCHED_HEADER: lt->type = LFT_ICAP_LAST_MATCHED_ALL_HEADERS; break;
-            case LFT_ICAP_REQ_HEADER: lt->type = LFT_ICAP_REQ_ALL_HEADERS; break; 
-            case LFT_ICAP_REP_HEADER: lt->type = LFT_ICAP_REP_ALL_HEADERS; break;
+            case LFT_ICAP_LAST_MATCHED_HEADER:
+                lt->type = LFT_ICAP_LAST_MATCHED_ALL_HEADERS;
+                break;
+            case LFT_ICAP_REQ_HEADER:
+                lt->type = LFT_ICAP_REQ_ALL_HEADERS;
+                break;
+            case LFT_ICAP_REP_HEADER:
+                lt->type = LFT_ICAP_REP_ALL_HEADERS;
+                break;
 #endif
-            default:break;
+            default:
+                break;
             }
             Config.onoff.log_mime_hdrs = 1;
         }
@@ -1427,7 +1448,7 @@ done:
 
     case LFT_HTTP_SENT_STATUS_CODE_OLD_30:
         debugs(46, 0, "WARNING: the \"Hs\" formating code is deprecated use the \">Hs\" instead");
-       lt->type = LFT_HTTP_SENT_STATUS_CODE;
+        lt->type = LFT_HTTP_SENT_STATUS_CODE;
         break;
     default:
         break;
@@ -1506,15 +1527,26 @@ accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definit
 
                     arg = argbuf;
 
-                    switch(type) {
-                    case LFT_REQUEST_HEADER_ELEM: type = LFT_REQUEST_HEADER_ELEM; break;
-                    case LFT_REPLY_HEADER_ELEM: type = LFT_REPLY_HEADER_ELEM; break;
+                    switch (type) {
+                    case LFT_REQUEST_HEADER_ELEM:
+                        type = LFT_REQUEST_HEADER_ELEM;
+                        break;
+                    case LFT_REPLY_HEADER_ELEM:
+                        type = LFT_REPLY_HEADER_ELEM;
+                        break;
 #if ICAP_CLIENT
-                    case LFT_ICAP_LAST_MATCHED_HEADER_ELEM: type = LFT_ICAP_LAST_MATCHED_HEADER; break;
-                    case LFT_ICAP_REQ_HEADER_ELEM: type = LFT_ICAP_REQ_HEADER; break; 
-                    case LFT_ICAP_REP_HEADER_ELEM: type = LFT_ICAP_REP_HEADER; break;
+                    case LFT_ICAP_LAST_MATCHED_HEADER_ELEM:
+                        type = LFT_ICAP_LAST_MATCHED_HEADER;
+                        break;
+                    case LFT_ICAP_REQ_HEADER_ELEM:
+                        type = LFT_ICAP_REQ_HEADER;
+                        break;
+                    case LFT_ICAP_REP_HEADER_ELEM:
+                        type = LFT_ICAP_REP_HEADER;
+                        break;
 #endif
-                    default:break;
+                    default:
+                        break;
                     }
 
                     break;
@@ -1529,15 +1561,26 @@ accessLogDumpLogFormat(StoreEntry * entry, const char *name, logformat * definit
                 case LFT_ICAP_REP_ALL_HEADERS:
 #endif
 
-                    switch(type) {
-                    case LFT_REQUEST_ALL_HEADERS: type = LFT_REQUEST_HEADER; break;
-                    case LFT_REPLY_ALL_HEADERS: type = LFT_REPLY_HEADER; break;
+                    switch (type) {
+                    case LFT_REQUEST_ALL_HEADERS:
+                        type = LFT_REQUEST_HEADER;
+                        break;
+                    case LFT_REPLY_ALL_HEADERS:
+                        type = LFT_REPLY_HEADER;
+                        break;
 #if ICAP_CLIENT
-                    case LFT_ICAP_LAST_MATCHED_ALL_HEADERS: type = LFT_ICAP_LAST_MATCHED_HEADER; break;
-                    case LFT_ICAP_REQ_ALL_HEADERS: type = LFT_ICAP_REQ_HEADER; break; 
-                    case LFT_ICAP_REP_ALL_HEADERS: type = LFT_ICAP_REP_HEADER; break;
+                    case LFT_ICAP_LAST_MATCHED_ALL_HEADERS:
+                        type = LFT_ICAP_LAST_MATCHED_HEADER;
+                        break;
+                    case LFT_ICAP_REQ_ALL_HEADERS:
+                        type = LFT_ICAP_REQ_HEADER;
+                        break;
+                    case LFT_ICAP_REP_ALL_HEADERS:
+                        type = LFT_ICAP_REP_HEADER;
+                        break;
 #endif
-                    default:break;
+                    default:
+                        break;
                     }
 
                     break;
@@ -1776,24 +1819,24 @@ accessLogICAPSquid(AccessLogEntry * al, Logfile * logfile)
     if (user && !*user)
         safe_free(user);
 
-        logfilePrintf(logfile, "%9ld.%03d %6d %s -/%03d %"PRId64" %s %s %s -/%s -\n",
-                      (long int) current_time.tv_sec,
-                      (int) current_time.tv_usec / 1000,
+    logfilePrintf(logfile, "%9ld.%03d %6d %s -/%03d %"PRId64" %s %s %s -/%s -\n",
+                  (long int) current_time.tv_sec,
+                  (int) current_time.tv_usec / 1000,
 
-                      al->icap.trTime,
-                      client,
+                  al->icap.trTime,
+                  client,
 
-                      al->icap.resStatus,
-                      al->icap.bytesRead,
-                      Adaptation::Icap::ICAP::methodStr(al->icap.reqMethod),
-                      al->icap.reqUri.termedBuf(),
-                      user ? user : dash_str,
-                      al->icap.hostAddr.NtoA(tmp, MAX_IPSTRLEN));
+                  al->icap.resStatus,
+                  al->icap.bytesRead,
+                  Adaptation::Icap::ICAP::methodStr(al->icap.reqMethod),
+                  al->icap.reqUri.termedBuf(),
+                  user ? user : dash_str,
+                  al->icap.hostAddr.NtoA(tmp, MAX_IPSTRLEN));
     safe_free(user);
 }
 #endif
 
-void 
+void
 accessLogLogTo(customlog* log, AccessLogEntry * al, ACLChecklist * checklist)
 {
 
@@ -1874,7 +1917,7 @@ accessLogLog(AccessLogEntry * al, ACLChecklist * checklist)
 {
     if (LogfileStatus != LOG_ENABLE)
         return;
-    
+
     accessLogLogTo(Config.Log.accesslogs, al, checklist);
 #if MULTICAST_MISS_STREAM
 
@@ -2010,19 +2053,17 @@ accessLogInit(void)
 #if USE_ADAPTATION || ICAP_CLIENT
         alLogformatHasAdaptToken = false;
         alLogformatHasIcapToken = false;
-        for (logformat_token * curr_token = (log->logFormat?log->logFormat->format:NULL); curr_token; curr_token = curr_token->next)
-        {
+        for (logformat_token * curr_token = (log->logFormat?log->logFormat->format:NULL); curr_token; curr_token = curr_token->next) {
 #if USE_ADAPTATION
             if (curr_token->type == LTF_ADAPTATION_SUM_XACT_TIMES ||
-                curr_token->type == LTF_ADAPTATION_ALL_XACT_TIMES) {
+                    curr_token->type == LTF_ADAPTATION_ALL_XACT_TIMES) {
                 alLogformatHasAdaptToken = true;
             }
-#endif    
+#endif
 #if ICAP_CLIENT
             if (curr_token->type == LFT_ICAP_LAST_MATCHED_HEADER ||
-                curr_token->type == LFT_ICAP_LAST_MATCHED_HEADER_ELEM ||
-                curr_token->type == LFT_ICAP_LAST_MATCHED_ALL_HEADERS)
-            {
+                    curr_token->type == LFT_ICAP_LAST_MATCHED_HEADER_ELEM ||
+                    curr_token->type == LFT_ICAP_LAST_MATCHED_ALL_HEADERS) {
                 alLogformatHasIcapToken = true;
             }
 #endif
index 589056adbe1a970b8bda746cb9bd97de34afdc51..a5347442a5dbb602a45e4b49b74bbd894d844ee2 100644 (file)
@@ -91,7 +91,7 @@ ACLMethodData::parse()
 
     for (Tail = &values; *Tail; Tail = &((*Tail)->next));
     while ((t = strtokFile())) {
-        if(strcmp(t, "PURGE") == 0)
+        if (strcmp(t, "PURGE") == 0)
             ++ThePurgeCount; // configuration code wants to know
         CbDataList<HttpRequestMethod> *q = new CbDataList<HttpRequestMethod> (HttpRequestMethod(t, NULL));
         *(Tail) = q;
index e3350a466b3d4546ce87e96977b77fec1fd315d8..2f3a12617b43157b8d47a5923726ab52423719c9 100644 (file)
@@ -24,7 +24,7 @@ Adaptation::AccessCheck::Start(Method method, VectPoint vp,
     if (Config::Enabled) {
         // the new check will call the callback and delete self, eventually
         return AsyncStart(new AccessCheck(
-            ServiceFilter(method, vp, req, rep), cb, cbdata));
+                              ServiceFilter(method, vp, req, rep), cb, cbdata));
     }
 
     debugs(83, 3, HERE << "adaptation off, skipping");
@@ -34,10 +34,10 @@ Adaptation::AccessCheck::Start(Method method, VectPoint vp,
 Adaptation::AccessCheck::AccessCheck(const ServiceFilter &aFilter,
                                      AccessCheckCallback *aCallback,
                                      void *aCallbackData):
-    AsyncJob("AccessCheck"), filter(aFilter),
-    callback(aCallback),
-    callback_data(cbdataReference(aCallbackData)),
-    acl_checklist(NULL)
+        AsyncJob("AccessCheck"), filter(aFilter),
+        callback(aCallback),
+        callback_data(cbdataReference(aCallbackData)),
+        acl_checklist(NULL)
 {
 #if ICAP_CLIENT
     Adaptation::Icap::History::Pointer h = filter.request->icapHistory();
@@ -46,7 +46,7 @@ Adaptation::AccessCheck::AccessCheck(const ServiceFilter &aFilter,
 #endif
 
     debugs(93, 5, HERE << "AccessCheck constructed for " <<
-        methodStr(filter.method) << " " << vectPointStr(filter.point));
+           methodStr(filter.method) << " " << vectPointStr(filter.point));
 }
 
 Adaptation::AccessCheck::~AccessCheck()
@@ -61,9 +61,10 @@ Adaptation::AccessCheck::~AccessCheck()
 }
 
 void
-Adaptation::AccessCheck::start() {
-       AsyncJob::start();
-       check();
+Adaptation::AccessCheck::start()
+{
+    AsyncJob::start();
+    check();
 }
 
 /// Walk the access rules list to find rules with applicable service groups
@@ -184,7 +185,7 @@ bool
 Adaptation::AccessCheck::isCandidate(AccessRule &r)
 {
     debugs(93,7,HERE << "checking candidacy of " << r.id << ", group " <<
-        r.groupId);
+           r.groupId);
 
     ServiceGroupPointer g = FindGroup(r.groupId);
 
index f44bd84785c04fd5bdaf7184da14814e8d23e976..e7f9332e8cf82df1cccc0d85619f2b40804dccad 100644 (file)
@@ -54,7 +54,7 @@ Adaptation::Config::parseService()
     ServiceConfig *cfg = new ServiceConfig;
     if (!cfg->parse()) {
         fatalf("%s:%d: malformed adaptation service configuration",
-            cfg_filename, config_lineno);
+               cfg_filename, config_lineno);
     }
     serviceConfigs.push_back(cfg);
 }
index 18f0d7bf48d3b00cab3b0ac624d8d278eea737e8..70be7baaea2c386e34fde9bfd548a298aae7c5c1 100644 (file)
 const static char *TheNullServices = ",null,";
 
 Adaptation::History::Entry::Entry(const String &sid, const timeval &when):
-    service(sid), start(when), theRptm(-1), retried(false)
+        service(sid), start(when), theRptm(-1), retried(false)
 {
 }
 
 Adaptation::History::Entry::Entry():
-    start(current_time), theRptm(-1), retried(false)
+        start(current_time), theRptm(-1), retried(false)
 {
 }
 
@@ -33,7 +33,8 @@ int Adaptation::History::Entry::rptm()
 }
 
 
-Adaptation::History::History(): theNextServices(TheNullServices) {
+Adaptation::History::History(): theNextServices(TheNullServices)
+{
 }
 
 int Adaptation::History::recordXactStart(const String &sid, const timeval &when, bool retrying)
@@ -82,8 +83,7 @@ void Adaptation::History::sumLogString(const char *serviceId, String &s)
     for (ECI i = theEntries.begin(); i != theEntries.end(); ++i) {
         if (i->retried) { // do not log retried xact but accumulate their time
             retriedRptm += i->rptm();
-        } else
-        if (!serviceId || i->service == serviceId) {
+        } else if (!serviceId || i->service == serviceId) {
             if (s.size() > 0) // not the first logged time, must delimit
                 s.append(",");
 
@@ -99,7 +99,7 @@ void Adaptation::History::sumLogString(const char *serviceId, String &s)
     }
 
     // the last transaction is never retried or it would not be the last
-    Must(!retriedRptm); 
+    Must(!retriedRptm);
 }
 
 void Adaptation::History::updateXxRecord(const char *name, const String &value)
@@ -111,7 +111,7 @@ void Adaptation::History::updateXxRecord(const char *name, const String &value)
 bool Adaptation::History::getXxRecord(String &name, String &value) const
 {
     if (theXxName.size() <= 0)
-       return false;
+        return false;
 
     name = theXxName;
     value = theXxValue;
@@ -121,7 +121,7 @@ bool Adaptation::History::getXxRecord(String &name, String &value) const
 void Adaptation::History::updateNextServices(const String &services)
 {
     if (theNextServices != TheNullServices)
-       debugs(93,3, HERE << "old services: " << theNextServices);
+        debugs(93,3, HERE << "old services: " << theNextServices);
     debugs(93,3, HERE << "new services: " << services);
     Must(services != TheNullServices);
     theNextServices = services;
@@ -130,7 +130,7 @@ void Adaptation::History::updateNextServices(const String &services)
 bool Adaptation::History::extractNextServices(String &value)
 {
     if (theNextServices == TheNullServices)
-       return false;
+        return false;
 
     value = theNextServices;
     theNextServices = TheNullServices; // prevents resetting the plan twice
index c7f52c379ba6d3cbfef8c67b265ffdc0de729099..93614d75725af9cd4a799289be46dbee5ad1e264 100644 (file)
@@ -5,11 +5,13 @@
 #include "Array.h"
 #include "SquidString.h"
 
-namespace Adaptation {
+namespace Adaptation
+{
 
 
 /// collects information about adaptations related to a master transaction
-class History: public RefCountable {
+class History: public RefCountable
+{
 public:
     typedef RefCount<Adaptation::History> Pointer;
 
@@ -41,7 +43,8 @@ public:
 
 private:
     /// single Xaction stats (i.e., a historical record entry)
-    class Entry {
+    class Entry
+    {
     public:
         Entry(const String &serviceId, const timeval &when);
         Entry(); // required by Vector<>
@@ -58,8 +61,8 @@ private:
     public:
         bool retried; ///< whether the xaction was replaced by another
     };
-    
-    typedef Vector<Entry> Entries;  
+
+    typedef Vector<Entry> Entries;
     Entries theEntries; ///< historical record, in the order of xact starts
 
     // theXx* will become a map<string,string>, but we only support one record
index 80c340d82c5af3306a8df6af1d397ac2fb3a0adb..8d95daea676149e24acd6097e75be3f7a8c394aa 100644 (file)
@@ -30,7 +30,7 @@ public:
 /* Initiate */
 
 Adaptation::Initiate::Initiate(const char *aTypeName, Initiator *anInitiator):
-    AsyncJob(aTypeName), theInitiator(anInitiator)
+        AsyncJob(aTypeName), theInitiator(anInitiator)
 {
     assert(theInitiator);
 }
index d9239fbe3a871fa9b56be339b7ca8d581af2d80c..c422846031a9e0bdc9d02375073f32dc3f76fda1 100644 (file)
 
 
 Adaptation::Iterator::Iterator(Adaptation::Initiator *anInitiator,
-    HttpMsg *aMsg, HttpRequest *aCause,
-    const ServiceGroupPointer &aGroup):
-    AsyncJob("Iterator"),
-    Adaptation::Initiate("Iterator", anInitiator),
-    theGroup(aGroup),
-    theMsg(HTTPMSGLOCK(aMsg)),
-    theCause(aCause ? HTTPMSGLOCK(aCause) : NULL),
-    theLauncher(0),
-    iterations(0),
-    adapted(false)
+                               HttpMsg *aMsg, HttpRequest *aCause,
+                               const ServiceGroupPointer &aGroup):
+        AsyncJob("Iterator"),
+        Adaptation::Initiate("Iterator", anInitiator),
+        theGroup(aGroup),
+        theMsg(HTTPMSGLOCK(aMsg)),
+        theCause(aCause ? HTTPMSGLOCK(aCause) : NULL),
+        theLauncher(0),
+        iterations(0),
+        adapted(false)
 {
 }
 
@@ -58,9 +58,9 @@ void Adaptation::Iterator::step()
 
     if (iterations > Adaptation::Config::service_iteration_limit) {
         debugs(93,DBG_CRITICAL, "Adaptation iterations limit (" <<
-            Adaptation::Config::service_iteration_limit << ") exceeded:\n" <<
-            "\tPossible service loop with " <<
-            theGroup->kind << " " << theGroup->id << ", plan=" << thePlan);
+               Adaptation::Config::service_iteration_limit << ") exceeded:\n" <<
+               "\tPossible service loop with " <<
+               theGroup->kind << " " << theGroup->id << ", plan=" << thePlan);
         throw TexcHere("too many adaptations");
     }
 
@@ -69,7 +69,7 @@ void Adaptation::Iterator::step()
     debugs(93,5, HERE << "using adaptation service: " << service->cfg().key);
 
     theLauncher = initiateAdaptation(
-        service->makeXactLauncher(this, theMsg, theCause));
+                      service->makeXactLauncher(this, theMsg, theCause));
     Must(theLauncher);
     Must(!done());
 }
@@ -113,8 +113,8 @@ void Adaptation::Iterator::noteAdaptationQueryAbort(bool final)
     updatePlan(false);
 
     // can we replace the failed service (group-level bypass)?
-    const bool srcIntact = !theMsg->body_pipe || 
-        !theMsg->body_pipe->consumedSize();
+    const bool srcIntact = !theMsg->body_pipe ||
+                           !theMsg->body_pipe->consumedSize();
     // can we ignore the failure (compute while thePlan is not exhausted)?
     Must(!thePlan.exhausted());
     const bool canIgnore = thePlan.current()->cfg().bypass;
@@ -176,7 +176,7 @@ bool Adaptation::Iterator::updatePlan(bool adopt)
         debugs(85,3, HERE << "rejecting service-proposed plan");
         return false;
     }
-  
+
     debugs(85,3, HERE << "retiring old plan: " << thePlan);
     theGroup = new DynamicServiceChain(services, theGroup); // refcounted
     thePlan = ServicePlan(theGroup, filter());
@@ -196,8 +196,7 @@ Adaptation::ServiceFilter Adaptation::Iterator::filter() const
         method = methodReqmod;
         req = r;
         rep = NULL;
-    } else
-    if (HttpReply *r = dynamic_cast<HttpReply*>(theMsg)) {
+    } else if (HttpReply *r = dynamic_cast<HttpReply*>(theMsg)) {
         method = methodRespmod;
         req = theCause;
         rep = r;
index c17f302d3ec835f3d7b2e648559b0067136101ea..0a0b35483a96fe00e72cf5faffb3c133ce60c204 100644 (file)
@@ -14,16 +14,16 @@ namespace Adaptation
 
    Note: Initiate must be the first parent for cbdata to work. We use
    a temporary InitiatorHolder/toCbdata hacks and do not call cbdata
-   operations on the initiator directly. 
+   operations on the initiator directly.
 */
 
 /// iterates services in ServiceGroup, starting adaptation launchers
 class Iterator: public Initiate, public Initiator
 {
 public:
-    Iterator(Adaptation::Initiator *anInitiator, 
-        HttpMsg *virginHeader, HttpRequest *virginCause,
-        const Adaptation::ServiceGroupPointer &aGroup);
+    Iterator(Adaptation::Initiator *anInitiator,
+             HttpMsg *virginHeader, HttpRequest *virginCause,
+             const Adaptation::ServiceGroupPointer &aGroup);
     virtual ~Iterator();
 
     // Adaptation::Initiate: asynchronous communication with the initiator
index 1df77c3c23b22c24482a62c2a7cdde1951e88adf..f66ebd5c87f986612203c9085bdf722746fb2a35 100644 (file)
@@ -7,8 +7,8 @@
 #include "adaptation/ServiceConfig.h"
 
 Adaptation::ServiceConfig::ServiceConfig():
-    port(-1), method(methodNone), point(pointNone),
-    bypass(false), routing(false)
+        port(-1), method(methodNone), point(pointNone),
+        bypass(false), routing(false)
 {}
 
 const char *
@@ -91,12 +91,11 @@ Adaptation::ServiceConfig::parse()
         bool grokked = false;
         if (strcmp(name, "bypass") == 0)
             grokked = grokBool(bypass, name, value);
-        else
-        if (strcmp(name, "routing") == 0)
+        else if (strcmp(name, "routing") == 0)
             grokked = grokBool(routing, name, value);
         else {
             debugs(3, 0, cfg_filename << ':' << config_lineno << ": " <<
-                "unknown adaptation service option: " << name << '=' << value);
+                   "unknown adaptation service option: " << name << '=' << value);
         }
         if (!grokked)
             return false;
@@ -109,15 +108,15 @@ Adaptation::ServiceConfig::parse()
     // there should be nothing else left
     if (const char *tail = strtok(NULL, w_space)) {
         debugs(3, 0, cfg_filename << ':' << config_lineno << ": " <<
-            "garbage after adaptation service URI: " << tail);
+               "garbage after adaptation service URI: " << tail);
         return false;
     }
 
     debugs(3,5, cfg_filename << ':' << config_lineno << ": " <<
-        "adaptation_service " << key << ' ' <<
-            methodStr() << "_" << vectPointStr() << ' ' <<
-            bypass << routing << ' ' <<
-            uri);
+           "adaptation_service " << key << ' ' <<
+           methodStr() << "_" << vectPointStr() << ' ' <<
+           bypass << routing << ' ' <<
+           uri);
 
     return true;
 }
@@ -210,8 +209,7 @@ Adaptation::ServiceConfig::grokBool(bool &var, const char *name, const char *val
 {
     if (!strcmp(value, "0") || !strcmp(value, "off"))
         var = false;
-    else
-    if (!strcmp(value, "1") || !strcmp(value, "on"))
+    else if (!strcmp(value, "1") || !strcmp(value, "on"))
         var = true;
     else {
         debugs(3, 0, HERE << cfg_filename << ':' << config_lineno << ": " <<
index 64cb122a09f3fb230fc9bc2c13acc48a50d94dd7..6fdd8a53bd097550a3b18518b90a139318873369 100644 (file)
@@ -37,7 +37,7 @@ public:
 protected:
     Method parseMethod(const char *buf) const;
     VectPoint parseVectPoint(const char *buf) const;
+
     /// interpret parsed values
     bool grokBool(bool &var, const char *name, const char *value);
     bool grokUri(const char *value);
index e2ac63a29cd35154631d33fdd91292d1429edc42..eb3965b89c49a3bfaf387eeaa7d8acd6a5ca69a1 100644 (file)
@@ -5,18 +5,18 @@
 
 
 Adaptation::ServiceFilter::ServiceFilter(Method aMethod, VectPoint aPoint,
-HttpRequest *aReq, HttpReply *aRep): method(aMethod), point(aPoint),
-    request(HTTPMSGLOCK(aReq)),
-    reply(aRep ? HTTPMSGLOCK(aRep) : NULL)
+        HttpRequest *aReq, HttpReply *aRep): method(aMethod), point(aPoint),
+        request(HTTPMSGLOCK(aReq)),
+        reply(aRep ? HTTPMSGLOCK(aRep) : NULL)
 {
     // a lot of code assumes that there is always a virgin request or cause
     assert(request);
 }
 
 Adaptation::ServiceFilter::ServiceFilter(const ServiceFilter &f):
-    method(f.method), point(f.point),
-    request(HTTPMSGLOCK(f.request)),
-    reply(f.reply ? HTTPMSGLOCK(f.reply) : NULL)
+        method(f.method), point(f.point),
+        request(HTTPMSGLOCK(f.request)),
+        reply(f.reply ? HTTPMSGLOCK(f.reply) : NULL)
 {
 }
 
index c1ffd2551a9f278349f2e766392490f2bbb555e9..8787b293a45f28be87009469cff945c98bf7f63e 100644 (file)
@@ -11,8 +11,8 @@
 #define ServiceGroup ServiceGroup
 
 Adaptation::ServiceGroup::ServiceGroup(const String &aKind, bool allSame):
-    kind(aKind), method(methodNone), point(pointNone),
-    allServicesSame(allSame)
+        kind(aKind), method(methodNone), point(pointNone),
+        allServicesSame(allSame)
 {
 }
 
@@ -48,7 +48,7 @@ Adaptation::ServiceGroup::finalize()
         const String &sid = services[pos];
         ServicePointer service = at(pos);
         if (service != NULL) {
-            if (method == methodNone) { 
+            if (method == methodNone) {
                 // optimization: cache values that should be the same
                 method = service->cfg().method;
                 point = service->cfg().point;
@@ -61,18 +61,17 @@ Adaptation::ServiceGroup::finalize()
 
             checkUniqueness(pos);
 
-            if (allServicesSame) { 
+            if (allServicesSame) {
                 if (!baselineKey.size()) {
                     baselineKey = service->cfg().key;
                     baselineBypass = service->cfg().bypass;
-                } else
-                if (baselineBypass != service->cfg().bypass) {
+                } else if (baselineBypass != service->cfg().bypass) {
                     debugs(93,0, "WARNING: Inconsistent bypass in " << kind <<
-                        ' ' << id << " may produce surprising results: " <<
-                        baselineKey << " vs. " << sid);
+                           ' ' << id << " may produce surprising results: " <<
+                           baselineKey << " vs. " << sid);
                 }
             }
-        } else { 
+        } else {
             finalizeMsg("ERROR: Unknown adaptation name", sid, true);
         }
     }
@@ -91,8 +90,7 @@ Adaptation::ServiceGroup::checkUniqueness(const Pos checkedPos) const
         ServicePointer s = at(p);
         if (s != NULL && s->cfg().key == checkedService->cfg().key)
             finalizeMsg("duplicate service name", s->cfg().key, false);
-        else
-        if (s != NULL && s->cfg().uri == checkedService->cfg().uri)
+        else if (s != NULL && s->cfg().uri == checkedService->cfg().uri)
             finalizeMsg("duplicate service URI", s->cfg().uri, false);
     }
 }
@@ -100,15 +98,16 @@ Adaptation::ServiceGroup::checkUniqueness(const Pos checkedPos) const
 /// emits a formatted warning or error message at the appropriate dbg level
 void
 Adaptation::ServiceGroup::finalizeMsg(const char *msg, const String &culprit,
-    bool error) const
+                                      bool error) const
 {
-    const int level = error ? DBG_CRITICAL : DBG_IMPORTANT;
+    const int level = error ? DBG_CRITICAL :DBG_IMPORTANT;
     const char *pfx = error ? "ERROR: " : "WARNING: ";
     debugs(93,level, pfx << msg << ' ' << culprit << " in " << kind << " '" <<
-        id << "'");
+           id << "'");
 }
 
-Adaptation::ServicePointer Adaptation::ServiceGroup::at(const Pos pos) const {
+Adaptation::ServicePointer Adaptation::ServiceGroup::at(const Pos pos) const
+{
     return FindService(services[pos]);
 }
 
@@ -213,7 +212,7 @@ Adaptation::ServiceChain::ServiceChain(): ServiceGroup("adaptation chain", false
 /* ServiceChain */
 
 Adaptation::DynamicServiceChain::DynamicServiceChain(const String &ids,
-    const ServiceGroupPointer prev)
+        const ServiceGroupPointer prev)
 {
     kind = "dynamic adaptation chain"; // TODO: optimize by using String const
     id = ids; // use services ids as the dynamic group ID
@@ -241,8 +240,8 @@ Adaptation::ServicePlan::ServicePlan(): pos(0), atEof(true)
 }
 
 Adaptation::ServicePlan::ServicePlan(const ServiceGroupPointer &g,
-    const ServiceFilter &filter):
-    group(g), pos(0), atEof(!g || !g->has(pos))
+                                     const ServiceFilter &filter):
+        group(g), pos(0), atEof(!g || !g->has(pos))
 {
     // this will find the first service because starting pos is zero
     if (!atEof && !group->findService(filter, pos))
@@ -257,14 +256,16 @@ Adaptation::ServicePlan::current() const
 }
 
 Adaptation::ServicePointer
-Adaptation::ServicePlan::replacement(const ServiceFilter &filter) {
+Adaptation::ServicePlan::replacement(const ServiceFilter &filter)
+{
     if (!atEof && !group->findReplacement(filter, ++pos))
         atEof = true;
     return current();
 }
 
 Adaptation::ServicePointer
-Adaptation::ServicePlan::next(const ServiceFilter &filter) {
+Adaptation::ServicePlan::next(const ServiceFilter &filter)
+{
     if (!atEof && !group->findLink(filter, ++pos))
         atEof = true;
     return current();
@@ -277,7 +278,7 @@ Adaptation::ServicePlan::print(std::ostream &os) const
         return os << "[nil]";
 
     return os << group->id << '[' << pos << ".." << group->services.size() <<
-        (atEof ? ".]" : "]");
+           (atEof ? ".]" : "]");
 }
 
 
index 7f2f318812a1fb9946c391f91e77fa6345f8575c..30b03234f64c5b3c633a299640b71eecfea9ed5b 100644 (file)
@@ -81,7 +81,7 @@ public:
     SingleService(const String &aServiceKey);
 
 protected:
-    virtual bool replace(Pos &pos) const { return false; } 
+    virtual bool replace(Pos &pos) const { return false; }
     virtual bool advance(Pos &pos) const { return false; }
 };
 
@@ -92,7 +92,7 @@ public:
     ServiceChain();
 
 protected:
-    virtual bool replace(Pos &pos) const { return false; } 
+    virtual bool replace(Pos &pos) const { return false; }
     virtual bool advance(Pos &pos) const { return has(++pos); }
 };
 
@@ -106,7 +106,8 @@ public:
 
 /** iterates services stored in a group; iteration is not linear because we
     need to both replace failed services and advance to the next chain link */
-class ServicePlan {
+class ServicePlan
+{
 public:
     typedef unsigned int Pos; // Vector<>::poistion_type
 
index 4e7793c9ac6a0efa3d17afbcdb26274a0ab28483..03fd5380c67fbf598bf99ae2b3d83747362b9e8b 100644 (file)
@@ -11,7 +11,8 @@
 
 namespace Adaptation
 {
-namespace Ecap {
+namespace Ecap
+{
 
 class Config: public Adaptation::Config
 {
index b0a246438d38ba26d090076077c755e68e87eb2d..481927bd2beeb1963b245348696c5c4059bb4f30 100644 (file)
@@ -10,7 +10,8 @@
 
 namespace Adaptation
 {
-namespace Ecap {
+namespace Ecap
+{
 
 // Squid wrapper, providing host application functionality to eCAP services.
 class Host : public libecap::host::Host
index 5888a8867179e2c5e694ff11775b1abbf4bdfbfb..f494d2d3b27422e8caa9eca07016240a67e00053 100644 (file)
@@ -348,11 +348,10 @@ Adaptation::Ecap::MessageRep::MessageRep(HttpMsg *rawHeader):
 
     if (HttpRequest *req = dynamic_cast<HttpRequest*>(theMessage.header))
         theFirstLineRep = new RequestLineRep(*req);
+    else if (HttpReply *rep = dynamic_cast<HttpReply*>(theMessage.header))
+        theFirstLineRep = new StatusLineRep(*rep);
     else
-        if (HttpReply *rep = dynamic_cast<HttpReply*>(theMessage.header))
-            theFirstLineRep = new StatusLineRep(*rep);
-        else
-            Must(false); // unknown message header type
+        Must(false); // unknown message header type
 
     theHeaderRep = new HeaderRep(*theMessage.header);
 
index dccac52cc00b0245ec7d48a1246f5ab318fa2b21..cd7fcb32a7a4e044c31e1409f788f38c605d16ee 100644 (file)
@@ -21,7 +21,8 @@ class HttpReply;
 
 namespace Adaptation
 {
-namespace Ecap {
+namespace Ecap
+{
 
 class XactionRep;
 
index f115820e455a728664740d795e149e38b0736116..f80f0f4206073910a685986daacfd2b93a744edc 100644 (file)
@@ -13,7 +13,8 @@
 
 namespace Adaptation
 {
-namespace Ecap {
+namespace Ecap
+{
 
 /* The eCAP service representative maintains information about a single eCAP
    service that Squid communicates with. One eCAP module may register many
index f92bb88304a0872af507a7c7b8e86c85f9952459..c78a1096d79a2925a552dcbf44ab51fd8f7ed3e7 100644 (file)
@@ -20,7 +20,7 @@ Adaptation::Ecap::XactionRep::XactionRep(Adaptation::Initiator *anInitiator,
         theVirginRep(virginHeader), theCauseRep(NULL),
         proxyingVb(opUndecided), proxyingAb(opUndecided),
         adaptHistoryId(-1),
-               canAccessVb(false),
+        canAccessVb(false),
         abProductionFinished(false), abProductionAtEnd(false)
 {
     if (virginCause)
@@ -60,10 +60,10 @@ Adaptation::Ecap::XactionRep::start()
         proxyingVb = opNever;
 
     const HttpRequest *request = dynamic_cast<const HttpRequest*> (theCauseRep ?
-        theCauseRep->raw().header : theVirginRep.raw().header);
+                                 theCauseRep->raw().header : theVirginRep.raw().header);
     Must(request);
     Adaptation::History::Pointer ah = request->adaptLogHistory();
-    if (ah != NULL) { 
+    if (ah != NULL) {
         // retrying=false because ecap never retries transactions
         adaptHistoryId = ah->recordXactStart(service().cfg().key, current_time, false);
     }
@@ -96,7 +96,7 @@ Adaptation::Ecap::XactionRep::swanSong()
     terminateMaster();
 
     const HttpRequest *request = dynamic_cast<const HttpRequest*>(theCauseRep ?
-        theCauseRep->raw().header : theVirginRep.raw().header);
+                                 theCauseRep->raw().header : theVirginRep.raw().header);
     Must(request);
     Adaptation::History::Pointer ah = request->adaptLogHistory();
     if (ah != NULL && adaptHistoryId >= 0)
@@ -188,11 +188,10 @@ Adaptation::Ecap::XactionRep::useVirgin()
         stopConsumingFrom(vbody_pipe);
         canAccessVb = false;
         proxyingVb = opComplete;
-    } else
-        if (proxyingVb == opUndecided) {
-            vbody_pipe = NULL; // it is not our pipe anymore
-            proxyingVb = opNever;
-        }
+    } else if (proxyingVb == opUndecided) {
+        vbody_pipe = NULL; // it is not our pipe anymore
+        proxyingVb = opNever;
+    }
 
     sendAnswer(clone);
     Must(done());
@@ -410,8 +409,7 @@ Adaptation::Ecap::XactionRep::moveAbContent()
         stopProducingFor(answer().body_pipe, abProductionAtEnd);
         proxyingAb = opComplete;
         debugs(93,5, HERE << "last adapted body data retrieved");
-    } else
-    if (c.size > 0) {
+    } else if (c.size > 0) {
         if (const size_t used = answer().body_pipe->putMoreData(c.start, c.size))
             theMaster->abContentShift(used);
     }
index 106eed2be520c1a46eceb70f3ae2cb86eb9b4267..542698dc33fe04da4c119c9e6d3aa3ee913cc142 100644 (file)
 
 namespace Adaptation
 {
-namespace Ecap {
+namespace Ecap
+{
 
 /* The eCAP xaction representative maintains information about a single eCAP
    xaction that Squid communicates with. One eCAP module may register many
    eCAP xactions. */
 class XactionRep : public Adaptation::Initiate, public libecap::host::Xaction,
-            public BodyConsumer, public BodyProducer
+        public BodyConsumer, public BodyProducer
 {
 public:
     XactionRep(Adaptation::Initiator *anInitiator, HttpMsg *virginHeader, HttpRequest *virginCause, const Adaptation::ServicePointer &service);
index 9dadf12e74bf2aeecfd2afb79e941282472500da..4bd6160b094af21b382dc84bd3f3f29e6f2b8b15 100644 (file)
@@ -39,7 +39,8 @@
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 extern void InitModule();
 extern void CleanModule();
index e338d5139d64ce8ac3308671d8fb37a503686cf0..eb8be9fdde0b740f997f61e2f1fe4261b5afa032 100644 (file)
@@ -45,7 +45,8 @@ class acl_access;
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 class ConfigParser;
 
index 5d1f0847322d6b3d1ca02d0540d23e8fa552b249..35cba8c40a40ae405714af572d18d2587d1f05bd 100644 (file)
@@ -2,8 +2,10 @@
 #include "adaptation/icap/Elements.h"
 
 // TODO: remove this file?
-namespace Adaptation {
-namespace Icap {
+namespace Adaptation
+{
+namespace Icap
+{
 
 const XactOutcome xoUnknown = "ICAP_ERR_UNKNOWN";
 const XactOutcome xoError = "ICAP_ERR_OTHER";
index ba5af8c866765d256ec355d0eba6c49f945ec16c..ab3b1c8f87e19457caabc92ed848269f6842fb9a 100644 (file)
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 //TODO: remove the ICAP namespace
-namespace ICAP {
+namespace ICAP
+{
 using Adaptation::Method;
 using Adaptation::methodNone;
 using Adaptation::methodRespmod;
index 56e52908274ead1dd616c87b6376c31db3e8666c..1b27e34485f2243edfc9cd9cee5634a9de174466 100644 (file)
@@ -4,8 +4,8 @@
 #include "SquidTime.h"
 
 Adaptation::Icap::History::History(): mergeOfIcapHeaders(hoRequest),
-    lastIcapHeader(hoRequest), logType(LOG_TAG_NONE), req_sz(0),
-    pastTime(0), concurrencyLevel(0)
+        lastIcapHeader(hoRequest), logType(LOG_TAG_NONE), req_sz(0),
+        pastTime(0), concurrencyLevel(0)
 {
 }
 
@@ -21,7 +21,7 @@ Adaptation::Icap::History::~History()
     rfc931.clean();
 #if USE_SSL
     ssluser.clean();
-#endif 
+#endif
     log_uri.clean();
 }
 
@@ -65,16 +65,16 @@ void Adaptation::Icap::History::mergeIcapHeaders(const HttpHeader * lih)
     mergeOfIcapHeaders.compact();
 }
 
-void Adaptation::Icap::History::start(const char *context) 
+void Adaptation::Icap::History::start(const char *context)
 {
     if (!concurrencyLevel++)
         currentStart = current_time;
 
     debugs(93,4, HERE << "start " << context << " level=" << concurrencyLevel
-        << " time=" << pastTime << ' ' << this);
+           << " time=" << pastTime << ' ' << this);
 }
 
-void Adaptation::Icap::History::stop(const char *context) 
+void Adaptation::Icap::History::stop(const char *context)
 {
     if (!concurrencyLevel) {
         debugs(93,1, HERE << "Internal error: poor history accounting " << this);
@@ -83,8 +83,8 @@ void Adaptation::Icap::History::stop(const char *context)
 
     const int current = currentTime();
     debugs(93,4, HERE << "stop " << context << " level=" << concurrencyLevel <<
-        " time=" << pastTime << '+' << current << ' ' << this);
-    
+           " time=" << pastTime << '+' << current << ' ' << this);
+
     if (!--concurrencyLevel)
         pastTime += current;
 }
@@ -99,5 +99,5 @@ int Adaptation::Icap::History::processingTime() const
 int Adaptation::Icap::History::currentTime() const
 {
     return concurrencyLevel > 0 ?
-        max(0, tvSubMsec(currentStart, current_time)) : 0;
+           max(0, tvSubMsec(currentStart, current_time)) : 0;
 }
index f3f398ee5a8761257b626242345e809ab3a5af07..e4cbd2579938a2d8a372007992b7061d73b2de88 100644 (file)
@@ -5,11 +5,14 @@
 #include "HttpHeader.h"
 #include "enums.h"
 
-namespace Adaptation {
-namespace Icap {
+namespace Adaptation
+{
+namespace Icap
+{
 
 /// collects information about ICAP processing related to an HTTP transaction
-class History: public RefCountable {
+class History: public RefCountable
+{
 public:
     typedef RefCount<History> Pointer;
 
index 9515e3ece24bcd0b161633f1ba50affd121f23c4..de0c6c39c5cfc817603f42892d1893d6b86871a6 100644 (file)
@@ -46,7 +46,8 @@
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 class InOut
 {
index 55144598a4c8d72de6b7d3feb2d0220a47cb110a..313a8b275b2a91d38945c8983ed4f0ea60663194 100644 (file)
@@ -72,7 +72,7 @@ void Adaptation::Icap::Launcher::noteAdaptationQueryAbort(bool final)
 {
     debugs(93,5, HERE << "launches: " << theLaunches << "; final: " << final);
     clearAdaptation(theXaction);
-       
+
     Must(done()); // swanSong will notify the initiator
 }
 
@@ -80,12 +80,11 @@ void Adaptation::Icap::Launcher::noteXactAbort(XactAbortInfo &info)
 {
     debugs(93,5, HERE << "theXaction:" << theXaction << " launches: " << theLaunches);
 
-     // TODO: add more checks from FwdState::checkRetry()?
+    // TODO: add more checks from FwdState::checkRetry()?
     if (canRetry(info)) {
         clearAdaptation(theXaction);
         launchXaction("retry");
-    } 
-    else if (canRepeat(info)) {
+    } else if (canRepeat(info)) {
         clearAdaptation(theXaction);
         launchXaction("repeat");
     } else {
@@ -93,7 +92,7 @@ void Adaptation::Icap::Launcher::noteXactAbort(XactAbortInfo &info)
         clearAdaptation(theXaction);
         tellQueryAborted(false); // caller decides based on bypass, consumption
         Must(done());
-    }   
+    }
 }
 
 bool Adaptation::Icap::Launcher::doneAll() const
@@ -132,15 +131,15 @@ bool Adaptation::Icap::Launcher::canRepeat(Adaptation::Icap::XactAbortInfo &info
     debugs(93,9, HERE << info.icapReply);
     if (!info.icapReply) // did not get to read an ICAP reply; a timeout?
         return true;
-       
+
     debugs(93,9, HERE << info.icapReply->sline.status);
     if (!info.icapReply->sline.status) // failed to parse the reply; I/O err
         return true;
-    
+
     ACLFilledChecklist *cl =
         new ACLFilledChecklist(TheConfig.repeat, info.icapRequest, dash_str);
     cl->reply = HTTPMSGLOCK(info.icapReply);
-    
+
     const bool result = cl->fastCheck();
     delete cl;
     return result;
@@ -149,17 +148,17 @@ bool Adaptation::Icap::Launcher::canRepeat(Adaptation::Icap::XactAbortInfo &info
 /* ICAPXactAbortInfo */
 
 Adaptation::Icap::XactAbortInfo::XactAbortInfo(HttpRequest *anIcapRequest,
-    HttpReply *anIcapReply, bool beRetriable, bool beRepeatable):
-    icapRequest(anIcapRequest ? HTTPMSGLOCK(anIcapRequest) : NULL),
-    icapReply(anIcapReply ? HTTPMSGLOCK(anIcapReply) : NULL),
-    isRetriable(beRetriable), isRepeatable(beRepeatable)
+        HttpReply *anIcapReply, bool beRetriable, bool beRepeatable):
+        icapRequest(anIcapRequest ? HTTPMSGLOCK(anIcapRequest) : NULL),
+        icapReply(anIcapReply ? HTTPMSGLOCK(anIcapReply) : NULL),
+        isRetriable(beRetriable), isRepeatable(beRepeatable)
 {
 }
 
 Adaptation::Icap::XactAbortInfo::XactAbortInfo(const Adaptation::Icap::XactAbortInfo &i):
-    icapRequest(i.icapRequest ? HTTPMSGLOCK(i.icapRequest) : NULL),
-    icapReply(i.icapReply ? HTTPMSGLOCK(i.icapReply) : NULL),
-    isRetriable(i.isRetriable), isRepeatable(i.isRepeatable)
+        icapRequest(i.icapRequest ? HTTPMSGLOCK(i.icapRequest) : NULL),
+        icapReply(i.icapReply ? HTTPMSGLOCK(i.icapReply) : NULL),
+        isRetriable(i.isRetriable), isRepeatable(i.isRepeatable)
 {
 }
 
index 7d27bdb99bd436dd073256e5ef3e5fed0348993c..23ffffac5209c8a9154013c49a48b180faf74bd8 100644 (file)
@@ -61,7 +61,8 @@
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 class Xaction;
 class XactAbortInfo;
@@ -84,7 +85,7 @@ public:
 
 private:
     bool canRetry(XactAbortInfo &info) const; //< true if can retry in the case of persistent connection failures
-    bool canRepeat(XactAbortInfo &info) const; //< true if can repeat in the case of no or unsatisfactory response 
+    bool canRepeat(XactAbortInfo &info) const; //< true if can repeat in the case of no or unsatisfactory response
     virtual void noteAdaptationQueryAbort(bool final);
 
 protected:
@@ -103,9 +104,10 @@ protected:
     int theLaunches; // the number of transaction launches
 };
 
-/// helper class to pass information about aborted ICAP requests to 
+/// helper class to pass information about aborted ICAP requests to
 /// the Adaptation::Icap::Launcher class
-class XactAbortInfo {
+class XactAbortInfo
+{
 public:
     XactAbortInfo(HttpRequest *anIcapRequest, HttpReply *anIcapReply,
                   bool beRetriable, bool beRepeatable);
@@ -116,7 +118,7 @@ public:
     HttpReply *icapReply;
     bool isRetriable;
     bool isRepeatable;
-    
+
 private:
     XactAbortInfo &operator =(const XactAbortInfo &); // undefined
 };
@@ -129,19 +131,19 @@ inline std::ostream &operator << (std::ostream &os, Adaptation::Icap::XactAbortI
 }
 
 /// A Dialer class used to schedule the Adaptation::Icap::Launcher::noteXactAbort call
-class XactAbortCall: public UnaryMemFunT<Adaptation::Icap::Launcher, Adaptation::Icap::XactAbortInfo> {
+class XactAbortCall: public UnaryMemFunT<Adaptation::Icap::Launcher, Adaptation::Icap::XactAbortInfo>
+{
 public:
     typedef void (Adaptation::Icap::Launcher::*DialMethod)(Adaptation::Icap::XactAbortInfo &);
-    XactAbortCall(Adaptation::Icap::Launcher *launcer, DialMethod aMethod, 
+    XactAbortCall(Adaptation::Icap::Launcher *launcer, DialMethod aMethod,
                   const Adaptation::Icap::XactAbortInfo &info):
-    UnaryMemFunT<Adaptation::Icap::Launcher, Adaptation::Icap::XactAbortInfo>(launcer, NULL, info),
-       dialMethod(aMethod)
-    {}
+            UnaryMemFunT<Adaptation::Icap::Launcher, Adaptation::Icap::XactAbortInfo>(launcer, NULL, info),
+            dialMethod(aMethod) {}
     virtual void print(std::ostream &os) const {  os << '(' << "retriable:" << arg1.isRetriable << ", repeatable:" << arg1.isRepeatable << ')'; }
 
 public:
     DialMethod dialMethod;
-    
+
 protected:
     virtual void doDial() { (object->*dialMethod)(arg1); }
 };
index 3ffa7f1da7025b0ac7725c3ea3b4173ec82cfd6f..c99d33dce4a4239cbbfd6786d7c2dde55a81eb25 100644 (file)
@@ -163,13 +163,12 @@ void Adaptation::Icap::ModXact::handleCommWroteHeaders()
     // determine next step
     if (preview.enabled())
         state.writing = preview.done() ? State::writingPaused : State::writingPreview;
-    else
-        if (virginBody.expected())
-            state.writing = State::writingPrime;
-        else {
-            stopWriting(true);
-            return;
-        }
+    else if (virginBody.expected())
+        state.writing = State::writingPrime;
+    else {
+        stopWriting(true);
+        return;
+    }
 
     writeMore();
 }
@@ -319,7 +318,7 @@ void Adaptation::Icap::ModXact::closeChunk(MemBuf &buf)
 const HttpRequest &Adaptation::Icap::ModXact::virginRequest() const
 {
     const HttpRequest *request = virgin.cause ?
-        virgin.cause : dynamic_cast<const HttpRequest*>(virgin.header);
+                                 virgin.cause : dynamic_cast<const HttpRequest*>(virgin.header);
     Must(request);
     return *request;
 }
@@ -656,7 +655,7 @@ void Adaptation::Icap::ModXact::maybeAllocateHttpMsg()
     if (gotEncapsulated("res-hdr")) {
         adapted.setHeader(new HttpReply);
         setOutcome(service().cfg().method == ICAP::methodReqmod ?
-            xoSatisfied : xoModified);
+                   xoSatisfied : xoModified);
     } else if (gotEncapsulated("req-hdr")) {
         adapted.setHeader(new HttpRequest);
         setOutcome(xoModified);
@@ -763,7 +762,7 @@ void Adaptation::Icap::ModXact::parseIcapHead()
     // We need to store received ICAP headers for <icapLastHeader logformat option.
     // If we already have stored headers from previous ICAP transaction related to this
     // request, old headers will be replaced with the new one.
-    
+
     Adaptation::Icap::History::Pointer h = request->icapHistory();
     if (h != NULL) {
         h->mergeIcapHeaders(&icapReply->header);
@@ -857,7 +856,7 @@ void Adaptation::Icap::ModXact::prepEchoing()
     if (const HttpRequest *oldR = dynamic_cast<const HttpRequest*>(oldHead)) {
         HttpRequest *newR = new HttpRequest;
         newR->canonical = oldR->canonical ?
-            xstrdup(oldR->canonical) : NULL; // parse() does not set it
+                          xstrdup(oldR->canonical) : NULL; // parse() does not set it
         newHead = newR;
     } else if (dynamic_cast<const HttpReply*>(oldHead)) {
         HttpReply *newRep = new HttpReply;
@@ -1110,57 +1109,56 @@ void Adaptation::Icap::ModXact::finalizeLogInfo()
 {
     HttpRequest * request_ = NULL;
     HttpReply * reply_ = NULL;
-    if(!(request_ = dynamic_cast<HttpRequest*>(adapted.header)))
-    {
+    if (!(request_ = dynamic_cast<HttpRequest*>(adapted.header))) {
         request_ = (virgin.cause? virgin.cause: dynamic_cast<HttpRequest*>(virgin.header));
         reply_ = dynamic_cast<HttpReply*>(adapted.header);
     }
 
     Adaptation::Icap::History::Pointer h = request_->icapHistory();
-     Must(h != NULL); // ICAPXaction::maybeLog calls only if there is a log
-     al.icp.opcode = ICP_INVALID;
-     al.url = h->log_uri.termedBuf();
-     const Adaptation::Icap::ServiceRep  &s = service();
-     al.icap.reqMethod = s.cfg().method;
+    Must(h != NULL); // ICAPXaction::maybeLog calls only if there is a log
+    al.icp.opcode = ICP_INVALID;
+    al.url = h->log_uri.termedBuf();
+    const Adaptation::Icap::ServiceRep  &s = service();
+    al.icap.reqMethod = s.cfg().method;
 
-     al.cache.caddr = request_->client_addr;
+    al.cache.caddr = request_->client_addr;
 
-     al.request = HTTPMSGLOCK(request_);
-     if(reply_)
-         al.reply = HTTPMSGLOCK(reply_);
-     else
-         al.reply = NULL;
+    al.request = HTTPMSGLOCK(request_);
+    if (reply_)
+        al.reply = HTTPMSGLOCK(reply_);
+    else
+        al.reply = NULL;
 
-     if (h->rfc931.size())
-         al.cache.rfc931 = h->rfc931.termedBuf();
+    if (h->rfc931.size())
+        al.cache.rfc931 = h->rfc931.termedBuf();
 
 #if USE_SSL
-     if (h->ssluser.size())
-         al.cache.ssluser = h->ssluser.termedBuf();
+    if (h->ssluser.size())
+        al.cache.ssluser = h->ssluser.termedBuf();
 #endif
-     al.cache.code = h->logType;
-     al.cache.requestSize = h->req_sz;
-     if (reply_) {
-         al.http.code = reply_->sline.status;
-         al.http.content_type = reply_->content_type.termedBuf();
-         al.cache.replySize = replyBodySize + reply_->hdr_sz;
-         al.cache.highOffset = replyBodySize;
-         //don't set al.cache.objectSize because it hasn't exist yet
-
-         Packer p;
-         MemBuf mb;
-
-         mb.init();
-         packerToMemInit(&p, &mb);
-
-         reply_->header.packInto(&p);
-         al.headers.reply = xstrdup(mb.buf);
-
-         packerClean(&p);
-         mb.clean();
-     }
-     prepareLogWithRequestDetails(request_, &al);
-     Xaction::finalizeLogInfo();
+    al.cache.code = h->logType;
+    al.cache.requestSize = h->req_sz;
+    if (reply_) {
+        al.http.code = reply_->sline.status;
+        al.http.content_type = reply_->content_type.termedBuf();
+        al.cache.replySize = replyBodySize + reply_->hdr_sz;
+        al.cache.highOffset = replyBodySize;
+        //don't set al.cache.objectSize because it hasn't exist yet
+
+        Packer p;
+        MemBuf mb;
+
+        mb.init();
+        packerToMemInit(&p, &mb);
+
+        reply_->header.packInto(&p);
+        al.headers.reply = xstrdup(mb.buf);
+
+        packerClean(&p);
+        mb.clean();
+    }
+    prepareLogWithRequestDetails(request_, &al);
+    Xaction::finalizeLogInfo();
 }
 
 
@@ -1198,12 +1196,12 @@ void Adaptation::Icap::ModXact::makeRequestHeaders(MemBuf &buf)
         if (ah != NULL) {
             String name, value;
             if (ah->getXxRecord(name, value)) {
-                buf.Printf(SQUIDSTRINGPH ": " SQUIDSTRINGPH "\r\n",  
-                    SQUIDSTRINGPRINT(name), SQUIDSTRINGPRINT(value));
+                buf.Printf(SQUIDSTRINGPH ": " SQUIDSTRINGPH "\r\n",
+                           SQUIDSTRINGPRINT(name), SQUIDSTRINGPRINT(value));
             }
         }
     }
-    
+
 
     buf.Printf("Encapsulated: ");
 
@@ -1221,9 +1219,8 @@ void Adaptation::Icap::ModXact::makeRequestHeaders(MemBuf &buf)
         urlPath = request->urlpath;
         if (ICAP::methodRespmod == m)
             encapsulateHead(buf, "req-hdr", httpBuf, request);
-        else
-            if (ICAP::methodReqmod == m)
-                encapsulateHead(buf, "req-hdr", httpBuf, virgin.header);
+        else if (ICAP::methodReqmod == m)
+            encapsulateHead(buf, "req-hdr", httpBuf, virgin.header);
     }
 
     if (ICAP::methodRespmod == m)
@@ -1359,9 +1356,8 @@ void Adaptation::Icap::ModXact::decideOnPreview()
 
     if (!virginBody.expected())
         ad = 0;
-    else
-        if (virginBody.knownSize())
-            ad = min(static_cast<uint64_t>(ad), virginBody.size()); // not more than we have
+    else if (virginBody.knownSize())
+        ad = min(static_cast<uint64_t>(ad), virginBody.size()); // not more than we have
 
     debugs(93, 5, HERE << "should offer " << ad << "-byte preview " <<
            "(service wanted " << wantedSize << ")");
@@ -1513,11 +1509,10 @@ void Adaptation::Icap::ModXact::estimateVirginBody()
 
     if (virgin.cause)
         method = virgin.cause->method;
+    else if (HttpRequest *req = dynamic_cast<HttpRequest*>(msg))
+        method = req->method;
     else
-        if (HttpRequest *req = dynamic_cast<HttpRequest*>(msg))
-            method = req->method;
-        else
-            method = METHOD_NONE;
+        method = METHOD_NONE;
 
     int64_t size;
     // expectingBody returns true for zero-sized bodies, but we will not
@@ -1664,9 +1659,8 @@ void Adaptation::Icap::Preview::wrote(size_t size, bool wroteEof)
 
     if (wroteEof)
         theState = stIeof; // written size is irrelevant
-    else
-        if (theWritten >= theAd)
-            theState = stDone;
+    else if (theWritten >= theAd)
+        theState = stDone;
 }
 
 bool Adaptation::Icap::ModXact::fillVirginHttpHeader(MemBuf &mb) const
@@ -1699,24 +1693,26 @@ Adaptation::Icap::Xaction *Adaptation::Icap::ModXactLauncher::createXaction()
     return new Adaptation::Icap::ModXact(this, virgin.header, virgin.cause, s);
 }
 
-void Adaptation::Icap::ModXactLauncher::swanSong() {
+void Adaptation::Icap::ModXactLauncher::swanSong()
+{
     debugs(93, 5, HERE << "swan sings");
     updateHistory(false);
     Adaptation::Icap::Launcher::swanSong();
 }
 
-void Adaptation::Icap::ModXactLauncher::updateHistory(bool start) {
-     HttpRequest *r = virgin.cause ?
-         virgin.cause : dynamic_cast<HttpRequest*>(virgin.header);
-
-     // r should never be NULL but we play safe; TODO: add Should()
-     if (r) {
-         Adaptation::Icap::History::Pointer h = r->icapHistory();
-         if (h != NULL) {
-             if (start)
-                 h->start("ICAPModXactLauncher");
-             else
-                 h->stop("ICAPModXactLauncher");
-         }
-     }
+void Adaptation::Icap::ModXactLauncher::updateHistory(bool start)
+{
+    HttpRequest *r = virgin.cause ?
+                     virgin.cause : dynamic_cast<HttpRequest*>(virgin.header);
+
+    // r should never be NULL but we play safe; TODO: add Should()
+    if (r) {
+        Adaptation::Icap::History::Pointer h = r->icapHistory();
+        if (h != NULL) {
+            if (start)
+                h->start("ICAPModXactLauncher");
+            else
+                h->stop("ICAPModXactLauncher");
+        }
+    }
 }
index a98a351b8bbdd1ca4f282f8d410167424a897ac0..a837fcb242d05713e136fc88e032da411da75f41 100644 (file)
@@ -54,7 +54,8 @@ class ChunkedCodingParser;
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 // estimated future presence and size of something (e.g., HTTP body)
 
index b418f05edc963ffc1bf58d7c60577cebd6cfb5ff..c2119d5d34870abc70f1a4e22bbf6eb6240f6568 100644 (file)
@@ -39,7 +39,8 @@
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 /* OptXact sends an ICAP OPTIONS request to the ICAP service,
  * parses the ICAP response, and sends it to the initiator. A NULL response
index dca0d2dacf1888e91ab114326717d6c386c0585d..f17e2bf8a644fa0d66dbace1a74b877057c70344 100644 (file)
@@ -41,7 +41,8 @@ class wordlist;
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 /* Maintains options supported by a given ICAP service.
  * See RFC 3507, Section "4.10.2 OPTIONS Response". */
index cdb8770fe22eb5b2149cc2789ff252afbd26a607..f5fd4d05a6e1a3a5db8126dd7845f8f8fc6642d9 100644 (file)
@@ -451,12 +451,10 @@ const char *Adaptation::Icap::ServiceRep::status() const
 
         if (!theOptions)
             buf.append(",!opt", 5);
-        else
-            if (!theOptions->valid())
-                buf.append(",!valid", 7);
-            else
-                if (!theOptions->fresh())
-                    buf.append(",stale", 6);
+        else if (!theOptions->valid())
+            buf.append(",!valid", 7);
+        else if (!theOptions->fresh())
+            buf.append(",stale", 6);
     }
 
     if (theOptionsFetcher)
index 5abb339e1357d4b4d9b57343833b6a6ae1f141fb..0bbaaa5a1ff6505e33f2f6f97067d2e6aac06fe6 100644 (file)
@@ -43,7 +43,8 @@
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 class Options;
 class OptXact;
@@ -78,7 +79,7 @@ class OptXact;
 
 
 class ServiceRep : public RefCountable, public Adaptation::Service,
-            public Adaptation::Initiator
+        public Adaptation::Initiator
 {
 
 public:
index 8fa22629ee96be58599d7b2a0bffcc95b7277897..e7f4cc0749816d13a2e7bce7703191aee37c730f 100644 (file)
@@ -432,7 +432,7 @@ void Adaptation::Icap::Xaction::setOutcome(const Adaptation::Icap::XactOutcome &
 {
     if (al.icap.outcome != xoUnknown) {
         debugs(93, 3, HERE << "Warning: reseting outcome: from " <<
-            al.icap.outcome << " to " << xo);
+               al.icap.outcome << " to " << xo);
     } else {
         debugs(93, 4, HERE << xo);
     }
@@ -462,19 +462,20 @@ void Adaptation::Icap::Xaction::swanSong()
     Adaptation::Initiate::swanSong();
 }
 
-void Adaptation::Icap::Xaction::tellQueryAborted() {
+void Adaptation::Icap::Xaction::tellQueryAborted()
+{
     Adaptation::Icap::Launcher *l = dynamic_cast<Adaptation::Icap::Launcher*>(theInitiator.ptr());
     Adaptation::Icap::XactAbortInfo abortInfo(icapRequest, icapReply, retriable(), repeatable());
-    CallJob(91, 5, __FILE__, __LINE__, 
+    CallJob(91, 5, __FILE__, __LINE__,
             "Adaptation::Icap::Launcher::noteXactAbort",
             XactAbortCall(l, &Adaptation::Icap::Launcher::noteXactAbort, abortInfo) );
     clearInitiator();
 }
 
 
-void Adaptation::Icap::Xaction::maybeLog() {
-    if(IcapLogfileStatus == LOG_ENABLE)
-    {
+void Adaptation::Icap::Xaction::maybeLog()
+{
+    if (IcapLogfileStatus == LOG_ENABLE) {
         ACLChecklist *checklist = new ACLFilledChecklist(::Config.accessList.icap, al.request, dash_str);
         if (!::Config.accessList.icap || checklist->fastCheck()) {
             finalizeLogInfo();
@@ -489,12 +490,12 @@ void Adaptation::Icap::Xaction::finalizeLogInfo()
 {
     //prepare log data
     al.icp.opcode = ICP_INVALID;
-    
+
     const Adaptation::Icap::ServiceRep &s = service();
     al.icap.hostAddr = s.cfg().host.termedBuf();
     al.icap.serviceName = s.cfg().key;
     al.icap.reqUri = s.cfg().uri;
-    
+
     al.icap.ioTime = tvSubMsec(icap_tio_start, icap_tio_finish);
     al.icap.trTime = tvSubMsec(icap_tr_start, current_time);
 
index c8860f2a80918746bf33dec7195fdc3707ba3e9c..322991601996960953fca7bb92504dabdb7ecb07 100644 (file)
@@ -46,7 +46,8 @@ class CommConnectCbParams;
 
 namespace Adaptation
 {
-namespace Icap {
+namespace Icap
+{
 
 /*
  * The ICAP Xaction implements common tasks for ICAP OPTIONS, REQMOD, and
index e1aa7547914e0d6f06178ef4aee9c426857cdc8a..fc149740e9572ccc3d102a451a2e7eccef11610f 100644 (file)
@@ -22,7 +22,7 @@ icapLogOpen()
     }
 }
 
-void 
+void
 icapLogClose()
 {
     customlog *log;
index a3cf1fdf97b79d84c08a3e91e36271642e1a4a5e..01c2f713ba235ff0693a43a4640e4c9de01d1a47 100644 (file)
@@ -602,8 +602,7 @@ AuthNegotiateUserRequest::releaseAuthServer()
         debugs(29, 6, HERE << "releasing Negotiate auth server '" << authserver << "'");
         helperStatefulReleaseServer(authserver);
         authserver = NULL;
-    }
-    else
+    } else
         debugs(29, 6, HERE << "No Negotiate auth server to release.");
 }
 
index 3f4d0c38bb7bdc128aa53e791f1862606dd871b9..bc1cb5e12b9cbe603b5b807ca3ae25aef15896d8 100644 (file)
@@ -516,10 +516,9 @@ AuthNTLMUserRequest::releaseAuthServer()
 {
     if (authserver) {
         debugs(29, 6, HERE << "releasing NTLM auth server '" << authserver << "'");
-       helperStatefulReleaseServer(authserver);
-       authserver = NULL;
-    }
-    else
+        helperStatefulReleaseServer(authserver);
+        authserver = NULL;
+    } else
         debugs(29, 6, HERE << "No NTLM auth server to release.");
 }
 
index 19dd089d92a8d3bb9fe250d2b0850050cdae4622..22a8d9fe90d0cf0116f18aacac332aa84309d2a1 100644 (file)
@@ -1648,7 +1648,7 @@ GetService(const char *proto)
         return 0; /* NEVER REACHED */
     }
     /** Returns either the service port number from /etc/services */
-    if( !isUnsignedNumeric(token, strlen(token)) )
+    if ( !isUnsignedNumeric(token, strlen(token)) )
         port = getservbyname(token, proto);
     if (port != NULL) {
         return ntohs((u_short)port->s_port);
@@ -2782,22 +2782,22 @@ parse_memcachemode(SquidConfig * config)
 {
     char *token = strtok(NULL, w_space);
     if (!token)
-       self_destruct();
+        self_destruct();
 
     if (strcmp(token, "always") == 0) {
-       Config.onoff.memory_cache_first = 1;
-       Config.onoff.memory_cache_disk = 1;
+        Config.onoff.memory_cache_first = 1;
+        Config.onoff.memory_cache_disk = 1;
     } else if (strcmp(token, "disk") == 0) {
-       Config.onoff.memory_cache_first = 0;
-       Config.onoff.memory_cache_disk = 1;
+        Config.onoff.memory_cache_first = 0;
+        Config.onoff.memory_cache_disk = 1;
     } else if (strncmp(token, "net", 3) == 0) {
-       Config.onoff.memory_cache_first = 1;
-       Config.onoff.memory_cache_disk = 0;
+        Config.onoff.memory_cache_first = 1;
+        Config.onoff.memory_cache_disk = 0;
     } else if (strcmp(token, "never") == 0) {
-       Config.onoff.memory_cache_first = 0;
-       Config.onoff.memory_cache_disk = 0;
+        Config.onoff.memory_cache_first = 0;
+        Config.onoff.memory_cache_disk = 0;
     } else
-       self_destruct();
+        self_destruct();
 }
 
 static void
@@ -2805,13 +2805,13 @@ dump_memcachemode(StoreEntry * entry, const char *name, SquidConfig &config)
 {
     storeAppendPrintf(entry, "%s ", name);
     if (Config.onoff.memory_cache_first && Config.onoff.memory_cache_disk)
-       storeAppendPrintf(entry, "always");
+        storeAppendPrintf(entry, "always");
     else if (!Config.onoff.memory_cache_first && Config.onoff.memory_cache_disk)
-       storeAppendPrintf(entry, "disk");
+        storeAppendPrintf(entry, "disk");
     else if (Config.onoff.memory_cache_first && !Config.onoff.memory_cache_disk)
-       storeAppendPrintf(entry, "network");
+        storeAppendPrintf(entry, "network");
     else if (!Config.onoff.memory_cache_first && !Config.onoff.memory_cache_disk)
-       storeAppendPrintf(entry, "none");
+        storeAppendPrintf(entry, "none");
     storeAppendPrintf(entry, "\n");
 }
 
index c895fecf66a2b04c10dec80d93912415bb2811a3..6d5d77c598742df24e275001723ecb357c941f10 100644 (file)
@@ -450,7 +450,7 @@ prepareLogWithRequestDetails(HttpRequest * request, AccessLogEntry * aLogEntry)
     assert(request);
     assert(aLogEntry);
 
-#if ICAP_CLIENT   
+#if ICAP_CLIENT
     Adaptation::Icap::History::Pointer ih = request->icapHistory();
 #endif
     if (Config.onoff.log_mime_hdrs) {
@@ -1898,13 +1898,14 @@ prepareTransparentURL(ConnStateData * conn, ClientHttpRequest *http, char *url,
 
 // Temporary hack helper: determine whether the request is chunked, expensive
 static bool
-isChunkedRequest(const HttpParser *hp) {
+isChunkedRequest(const HttpParser *hp)
+{
     HttpRequest request;
     if (!request.parseHeader(HttpParserHdrBuf(hp), HttpParserHdrSz(hp)))
-       return false;
+        return false;
 
     return request.header.has(HDR_TRANSFER_ENCODING) &&
-       request.header.hasListMember(HDR_TRANSFER_ENCODING, "chunked", ',');
+           request.header.hasListMember(HDR_TRANSFER_ENCODING, "chunked", ',');
 }
 
 
@@ -1936,8 +1937,7 @@ parseHttpRequest(ConnStateData *conn, HttpParser *hp, HttpRequestMethod * method
     if ( hp->bufsiz <= 0) {
         debugs(33, 5, "Incomplete request, waiting for end of request line");
         return NULL;
-    }
-    else if ( (size_t)hp->bufsiz >= Config.maxRequestHeaderSize && headersEnd(hp->buf, Config.maxRequestHeaderSize) == 0) {
+    } else if ( (size_t)hp->bufsiz >= Config.maxRequestHeaderSize && headersEnd(hp->buf, Config.maxRequestHeaderSize) == 0) {
         debugs(33, 5, "parseHttpRequest: Too large request");
         return parseHttpRequestAbort(conn, "error:request-too-large");
     }
@@ -2033,8 +2033,8 @@ parseHttpRequest(ConnStateData *conn, HttpParser *hp, HttpRequestMethod * method
     // logic to determine when it is valid to do so.
     // FUTURE_CODE_TO_SUPPORT_CHUNKED_REQUESTS below will replace this hack.
     if (hp->v_min == 1 && hp->v_maj == 1 && // broken client, may send chunks
-        Config.maxChunkedRequestBodySize > 0 && // configured to dechunk
-        (*method_p == METHOD_PUT || *method_p == METHOD_POST)) {
+            Config.maxChunkedRequestBodySize > 0 && // configured to dechunk
+            (*method_p == METHOD_PUT || *method_p == METHOD_POST)) {
 
         // check only once per request because isChunkedRequest is expensive
         if (conn->in.dechunkingState == ConnStateData::chunkUnknown) {
@@ -2743,15 +2743,15 @@ ConnStateData::handleRequestBodyData()
 {
     assert(bodyPipe != NULL);
 
-    size_t putSize = 0;    
+    size_t putSize = 0;
 
 #if FUTURE_CODE_TO_SUPPORT_CHUNKED_REQUESTS
-   // The code below works, in principle, but we cannot do dechunking 
-   // on-the-fly because that would mean sending chunked requests to
-   // the next hop. Squid lacks logic to determine which servers can
-   // receive chunk requests. Squid v3.0 code cannot even handle chunked
-   // responses which we may encourage by sending chunked requests.
-   // The error generation code probably needs more work.
+    // The code below works, in principle, but we cannot do dechunking
+    // on-the-fly because that would mean sending chunked requests to
+    // the next hop. Squid lacks logic to determine which servers can
+    // receive chunk requests. Squid v3.0 code cannot even handle chunked
+    // responses which we may encourage by sending chunked requests.
+    // The error generation code probably needs more work.
     if (in.bodyParser) { // chunked body
         debugs(33,5, HERE << "handling chunked request body for FD " << fd);
         bool malformedChunks = false;
@@ -2771,7 +2771,7 @@ ConnStateData::handleRequestBodyData()
             } else {
                 // parser needy state must imply body pipe needy state
                 if (in.bodyParser->needsMoreData() &&
-                    !bodyPipe->mayNeedMoreData())
+                        !bodyPipe->mayNeedMoreData())
                     malformedChunks = true;
                 // XXX: if bodyParser->needsMoreSpace, how can we guarantee it?
             }
@@ -2789,14 +2789,14 @@ ConnStateData::handleRequestBodyData()
                 clientReplyContext *repContext = dynamic_cast<clientReplyContext *>(node->data.getRaw());
                 assert (repContext);
                 repContext->setReplyToError(ERR_INVALID_REQ, HTTP_BAD_REQUEST,
-                    METHOD_NONE, NULL, &peer.sin_addr,
-                    NULL, NULL, NULL);
+                                            METHOD_NONE, NULL, &peer.sin_addr,
+                                            NULL, NULL, NULL);
                 context->pullData();
             }
             flags.readMoreRequests = false;
             return; // XXX: is that sufficient to generate an error?
         }
-    } else // identity encoding 
+    } else // identity encoding
 #endif
     {
         debugs(33,5, HERE << "handling plain request body for FD " << fd);
@@ -3612,7 +3612,7 @@ ConnStateData::finishDechunkingRequest(HttpParser *hp)
     debugs(33, 5, HERE << "finish dechunking; content: " << in.dechunked.contentSize());
 
     assert(in.dechunkingState == chunkReady);
-    assert(in.bodyParser); 
+    assert(in.bodyParser);
     delete in.bodyParser;
     in.bodyParser = NULL;
 
@@ -3620,7 +3620,7 @@ ConnStateData::finishDechunkingRequest(HttpParser *hp)
 
     // dechunking cannot make data bigger
     assert(headerSize + in.dechunked.contentSize() + in.chunked.contentSize()
-        <= static_cast<mb_size_t>(in.notYetUsed));
+           <= static_cast<mb_size_t>(in.notYetUsed));
     assert(in.notYetUsed <= in.allocatedSize);
 
     // copy dechunked content
@@ -3647,7 +3647,7 @@ bool
 ConnStateData::parseRequestChunks(HttpParser *)
 {
     debugs(33,5, HERE << "parsing chunked request body at " <<
-        in.chunkedSeen << " < " << in.notYetUsed);
+           in.chunkedSeen << " < " << in.notYetUsed);
     assert(in.bodyParser);
     assert(in.dechunkingState == chunkParsing);
 
@@ -3657,20 +3657,20 @@ ConnStateData::parseRequestChunks(HttpParser *)
     // be safe: count some chunked coding metadata towards the total body size
     if (fresh + in.dechunked.contentSize() > Config.maxChunkedRequestBodySize) {
         debugs(33,3, HERE << "chunked body (" << fresh << " + " <<
-            in.dechunked.contentSize() << " may exceed " <<
-            "chunked_request_body_max_size=" <<
-            Config.maxChunkedRequestBodySize);
+               in.dechunked.contentSize() << " may exceed " <<
+               "chunked_request_body_max_size=" <<
+               Config.maxChunkedRequestBodySize);
         in.dechunkingState = chunkError;
         return false;
     }
-        
+
     if (fresh > in.chunked.potentialSpaceSize()) {
         // should not happen if Config.maxChunkedRequestBodySize is reasonable
         debugs(33,1, HERE << "request_body_max_size exceeds chunked buffer " <<
-            "size: " << fresh << " + " << in.chunked.contentSize() << " > " <<
-            in.chunked.potentialSpaceSize() << " with " <<
-            "chunked_request_body_max_size=" <<
-            Config.maxChunkedRequestBodySize);
+               "size: " << fresh << " + " << in.chunked.contentSize() << " > " <<
+               in.chunked.potentialSpaceSize() << " with " <<
+               "chunked_request_body_max_size=" <<
+               Config.maxChunkedRequestBodySize);
         in.dechunkingState = chunkError;
         return false;
     }
@@ -3696,8 +3696,8 @@ ConnStateData::In::addressToReadInto() const
 }
 
 ConnStateData::In::In() : bodyParser(NULL),
-    buf (NULL), notYetUsed (0), allocatedSize (0),
-    dechunkingState(ConnStateData::chunkUnknown)
+        buf (NULL), notYetUsed (0), allocatedSize (0),
+        dechunkingState(ConnStateData::chunkUnknown)
 {}
 
 ConnStateData::In::~In()
index a40f7f528dc427a4cd9c76679e5af597f5eda79b..1a62846f167be960418b81553df2258a2bd67fab 100644 (file)
@@ -155,14 +155,14 @@ public:
         ~In();
         char *addressToReadInto() const;
 
-       ChunkedCodingParser *bodyParser; ///< parses chunked request body
-       MemBuf chunked; ///< contains unparsed raw (chunked) body data
-       MemBuf dechunked; ///< accumulates parsed (dechunked) content
+        ChunkedCodingParser *bodyParser; ///< parses chunked request body
+        MemBuf chunked; ///< contains unparsed raw (chunked) body data
+        MemBuf dechunked; ///< accumulates parsed (dechunked) content
         char *buf;
         size_t notYetUsed;
         size_t allocatedSize;
-       size_t chunkedSeen; ///< size of processed or ignored raw read data
-       DechunkingState dechunkingState; ///< request dechunking state
+        size_t chunkedSeen; ///< size of processed or ignored raw read data
+        DechunkingState dechunkingState; ///< request dechunking state
     } in;
 
     int64_t bodySizeLeft();
index b82653379d734df4da33550f07adbd5c38486074..383d9b9a105cf309d94f35bcc4b359000e883d20 100644 (file)
@@ -652,7 +652,7 @@ clientReplyContext::processMiss()
 
     /// Deny loops for accelerator and interceptor. TODO: deny in all modes?
     if (r->flags.loopdetect &&
-        (http->flags.accel || http->flags.intercepted)) {
+            (http->flags.accel || http->flags.intercepted)) {
         http->al.http.code = HTTP_FORBIDDEN;
         err = clientBuildError(ERR_ACCESS_DENIED, HTTP_FORBIDDEN, NULL, http->getConn()->peer, http->request);
         createStoreEntry(r->method, request_flags());
index 029d68ec16cd494002c5a6b150d180e63c11e6a5..0c92052ff411578a3a3b34da609f4fe7154fdb2e 100644 (file)
@@ -636,16 +636,14 @@ ClientRequestContext::adaptationAclCheckDone(Adaptation::ServiceGroupPointer g)
     debugs(93,3,HERE << this << " adaptationAclCheckDone called");
     assert(http);
 
-#if ICAP_CLIENT                                                                
+#if ICAP_CLIENT
     Adaptation::Icap::History::Pointer ih = http->request->icapHistory();
-    if(ih != NULL)
-    {                                                                          
-        if (http->getConn() != NULL)
-        {
+    if (ih != NULL) {
+        if (http->getConn() != NULL) {
             ih->rfc931 = http->getConn()->rfc931;
-#if USE_SSL                              
+#if USE_SSL
             ih->ssluser = sslGetUserEmail(fd_table[http->getConn()->fd].ssl);
-#endif  
+#endif
         }
         ih->log_uri = http->log_uri;
         ih->req_sz = http->req_sz;
@@ -1340,9 +1338,9 @@ ClientHttpRequest::startAdaptation(const Adaptation::ServiceGroupPointer &g)
     assert(!virginHeadSource);
     assert(!adaptedBodySource);
     virginHeadSource = initiateAdaptation(
-        new Adaptation::Iterator(this, request, NULL, g));
+                           new Adaptation::Iterator(this, request, NULL, g));
 
-    // we could try to guess whether we can bypass this adaptation 
+    // we could try to guess whether we can bypass this adaptation
     // initiation failure, but it should not really happen
     assert(virginHeadSource != NULL); // Must, really
 }
index f8a008fff858639b2fb05ec0c26069dccaffe029..f30335d171311e7651f64257416651f31e322d6b 100644 (file)
@@ -61,8 +61,8 @@ class ClientRequestContext;
 
 class ClientHttpRequest
 #if USE_ADAPTATION
-            : public Adaptation::Initiator, // to start adaptation transactions
-            public BodyConsumer     // to receive reply bodies in request satisf. mode
+        : public Adaptation::Initiator, // to start adaptation transactions
+        public BodyConsumer     // to receive reply bodies in request satisf. mode
 #endif
 {
 
index 4f6a1cd6731fe5d6ffce4dc3b5b11b40f0f9f3f0..cd6972c157d3eadd5dda3455fb23e9cd7060b9f6 100644 (file)
@@ -1858,7 +1858,8 @@ commUnsetNonBlocking(int fd)
 }
 
 void
-commSetCloseOnExec(int fd) {
+commSetCloseOnExec(int fd)
+{
 #ifdef FD_CLOEXEC
     int flags;
     int dummy = 0;
@@ -1878,7 +1879,8 @@ commSetCloseOnExec(int fd) {
 
 #ifdef TCP_NODELAY
 static void
-commSetTcpNoDelay(int fd) {
+commSetTcpNoDelay(int fd)
+{
     int on = 1;
 
     if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0)
@@ -1890,7 +1892,8 @@ commSetTcpNoDelay(int fd) {
 #endif
 
 void
-commSetTcpKeepalive(int fd, int idle, int interval, int timeout) {
+commSetTcpKeepalive(int fd, int idle, int interval, int timeout)
+{
     int on = 1;
 #ifdef TCP_KEEPCNT
     if (timeout && interval) {
@@ -1916,7 +1919,8 @@ commSetTcpKeepalive(int fd, int idle, int interval, int timeout) {
 }
 
 void
-comm_init(void) {
+comm_init(void)
+{
     fd_table =(fde *) xcalloc(Squid_MaxFD, sizeof(fde));
     fdd_table = (fd_debug_t *)xcalloc(Squid_MaxFD, sizeof(fd_debug_t));
 
@@ -1946,7 +1950,8 @@ comm_init(void) {
 }
 
 void
-comm_exit(void) {
+comm_exit(void)
+{
     delete TheHalfClosed;
     TheHalfClosed = NULL;
 
@@ -1961,7 +1966,8 @@ comm_exit(void) {
 
 /* Write to FD. */
 static void
-commHandleWrite(int fd, void *data) {
+commHandleWrite(int fd, void *data)
+{
     comm_io_callback_t *state = (comm_io_callback_t *)data;
     int len = 0;
     int nleft;
@@ -2029,7 +2035,8 @@ commHandleWrite(int fd, void *data) {
  * free_func is used to free the passed buffer when the write has completed.
  */
 void
-comm_write(int fd, const char *buf, int size, IOCB * handler, void *handler_data, FREE * free_func) {
+comm_write(int fd, const char *buf, int size, IOCB * handler, void *handler_data, FREE * free_func)
+{
     AsyncCall::Pointer call = commCbCall(5,5, "SomeCommWriteHander",
                                          CommIoCbPtrFun(handler, handler_data));
 
@@ -2037,7 +2044,8 @@ comm_write(int fd, const char *buf, int size, IOCB * handler, void *handler_data
 }
 
 void
-comm_write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE * free_func) {
+comm_write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE * free_func)
+{
     debugs(5, 5, "comm_write: FD " << fd << ": sz " << size << ": asynCall " << callback);
 
     /* Make sure we are open, not closing, and not writing */
@@ -2055,12 +2063,14 @@ comm_write(int fd, const char *buf, int size, AsyncCall::Pointer &callback, FREE
 
 /* a wrapper around comm_write to allow for MemBuf to be comm_written in a snap */
 void
-comm_write_mbuf(int fd, MemBuf *mb, IOCB * handler, void *handler_data) {
+comm_write_mbuf(int fd, MemBuf *mb, IOCB * handler, void *handler_data)
+{
     comm_write(fd, mb->buf, mb->size, handler, handler_data, mb->freeFunc());
 }
 
 void
-comm_write_mbuf(int fd, MemBuf *mb, AsyncCall::Pointer &callback) {
+comm_write_mbuf(int fd, MemBuf *mb, AsyncCall::Pointer &callback)
+{
     comm_write(fd, mb->buf, mb->size, callback, mb->freeFunc());
 }
 
@@ -2070,7 +2080,8 @@ comm_write_mbuf(int fd, MemBuf *mb, AsyncCall::Pointer &callback) {
  * like to use it.
  */
 int
-ignoreErrno(int ierrno) {
+ignoreErrno(int ierrno)
+{
     switch (ierrno) {
 
     case EINPROGRESS:
@@ -2099,7 +2110,8 @@ ignoreErrno(int ierrno) {
 }
 
 void
-commCloseAllSockets(void) {
+commCloseAllSockets(void)
+{
     int fd;
     fde *F = NULL;
 
@@ -2128,7 +2140,8 @@ commCloseAllSockets(void) {
 }
 
 static bool
-AlreadyTimedOut(fde *F) {
+AlreadyTimedOut(fde *F)
+{
     if (!F->flags.open)
         return true;
 
@@ -2142,7 +2155,8 @@ AlreadyTimedOut(fde *F) {
 }
 
 void
-checkTimeouts(void) {
+checkTimeouts(void)
+{
     int fd;
     fde *F = NULL;
     AsyncCall::Pointer callback;
@@ -2175,7 +2189,8 @@ checkTimeouts(void) {
  * accept()ed.
  */
 int
-comm_listen(int sock) {
+comm_listen(int sock)
+{
     int x;
 
     if ((x = listen(sock, Squid_MaxFD >> 2)) < 0) {
@@ -2208,7 +2223,8 @@ comm_listen(int sock) {
 }
 
 void
-comm_accept(int fd, IOACB *handler, void *handler_data) {
+comm_accept(int fd, IOACB *handler, void *handler_data)
+{
     debugs(5, 5, "comm_accept: FD " << fd << " handler: " << (void*)handler);
     assert(isOpen(fd));
 
@@ -2218,7 +2234,8 @@ comm_accept(int fd, IOACB *handler, void *handler_data) {
 }
 
 void
-comm_accept(int fd, AsyncCall::Pointer &call) {
+comm_accept(int fd, AsyncCall::Pointer &call)
+{
     debugs(5, 5, "comm_accept: FD " << fd << " AsyncCall: " << call);
     assert(isOpen(fd));
 
@@ -2228,7 +2245,8 @@ comm_accept(int fd, AsyncCall::Pointer &call) {
 // Called when somebody wants to be notified when our socket accepts new
 // connection. We do not probe the FD until there is such interest.
 void
-AcceptFD::subscribe(AsyncCall::Pointer &call) {
+AcceptFD::subscribe(AsyncCall::Pointer &call)
+{
     /* make sure we're not pending! */
     assert(!theCallback);
     theCallback = call;
@@ -2244,7 +2262,8 @@ AcceptFD::subscribe(AsyncCall::Pointer &call) {
 }
 
 bool
-AcceptFD::acceptOne() {
+AcceptFD::acceptOne()
+{
     // If there is no callback and we accept, we will leak the accepted FD.
     // When we are running out of FDs, there is often no callback.
     if (!theCallback) {
@@ -2293,12 +2312,14 @@ AcceptFD::acceptOne() {
 }
 
 void
-AcceptFD::acceptNext() {
+AcceptFD::acceptNext()
+{
     mayAcceptMore = acceptOne();
 }
 
 void
-AcceptFD::notify(int newfd, comm_err_t errcode, int xerrno, const ConnectionDetail &connDetails) {
+AcceptFD::notify(int newfd, comm_err_t errcode, int xerrno, const ConnectionDetail &connDetails)
+{
     if (theCallback != NULL) {
         typedef CommAcceptCbParams Params;
         Params &params = GetCommParams<Params>(theCallback);
@@ -2317,12 +2338,14 @@ AcceptFD::notify(int newfd, comm_err_t errcode, int xerrno, const ConnectionDeta
  * to dupe itself and fob off an accept()ed connection
  */
 static void
-comm_accept_try(int fd, void *) {
+comm_accept_try(int fd, void *)
+{
     assert(isOpen(fd));
     fdc_table[fd].acceptNext();
 }
 
-void CommIO::Initialise() {
+void CommIO::Initialise()
+{
     /* Initialize done pipe signal */
     int DonePipe[2];
     if (pipe(DonePipe)) {}
@@ -2336,7 +2359,8 @@ void CommIO::Initialise() {
     Initialised = true;
 }
 
-void CommIO::NotifyIOClose() {
+void CommIO::NotifyIOClose()
+{
     /* Close done pipe signal */
     FlushPipe();
     close(DoneFD);
@@ -2352,19 +2376,22 @@ int CommIO::DoneFD = -1;
 int CommIO::DoneReadFD = -1;
 
 void
-CommIO::FlushPipe() {
+CommIO::FlushPipe()
+{
     char buf[256];
     FD_READ_METHOD(DoneReadFD, buf, sizeof(buf));
 }
 
 void
-CommIO::NULLFDHandler(int fd, void *data) {
+CommIO::NULLFDHandler(int fd, void *data)
+{
     FlushPipe();
     commSetSelect(fd, COMM_SELECT_READ, NULLFDHandler, NULL, 0);
 }
 
 void
-CommIO::ResetNotifications() {
+CommIO::ResetNotifications()
+{
     if (DoneSignalled) {
         FlushPipe();
         DoneSignalled = false;
@@ -2373,17 +2400,20 @@ CommIO::ResetNotifications() {
 
 AcceptLimiter AcceptLimiter::Instance_;
 
-AcceptLimiter &AcceptLimiter::Instance() {
+AcceptLimiter &AcceptLimiter::Instance()
+{
     return Instance_;
 }
 
 bool
-AcceptLimiter::deferring() const {
+AcceptLimiter::deferring() const
+{
     return deferred.size() > 0;
 }
 
 void
-AcceptLimiter::defer (int fd, Acceptor::AcceptorFunction *aFunc, void *data) {
+AcceptLimiter::defer (int fd, Acceptor::AcceptorFunction *aFunc, void *data)
+{
     debugs(5, 5, "AcceptLimiter::defer: FD " << fd << " handler: " << (void*)aFunc);
     Acceptor temp;
     temp.theFunction = aFunc;
@@ -2393,7 +2423,8 @@ AcceptLimiter::defer (int fd, Acceptor::AcceptorFunction *aFunc, void *data) {
 }
 
 void
-AcceptLimiter::kick() {
+AcceptLimiter::kick()
+{
     if (!deferring())
         return;
 
@@ -2409,7 +2440,8 @@ AcceptLimiter::kick() {
 // by scheduling a read callback to a monitoring handler that
 // will close the connection on read errors.
 void
-commStartHalfClosedMonitor(int fd) {
+commStartHalfClosedMonitor(int fd)
+{
     debugs(5, 5, HERE << "adding FD " << fd << " to " << *TheHalfClosed);
     assert(isOpen(fd));
     assert(!commHasHalfClosedMonitor(fd));
@@ -2419,7 +2451,8 @@ commStartHalfClosedMonitor(int fd) {
 
 static
 void
-commPlanHalfClosedCheck() {
+commPlanHalfClosedCheck()
+{
     if (!WillCheckHalfClosed && !TheHalfClosed->empty()) {
         eventAdd("commHalfClosedCheck", &commHalfClosedCheck, NULL, 1.0, 1);
         WillCheckHalfClosed = true;
@@ -2430,7 +2463,8 @@ commPlanHalfClosedCheck() {
 /// calls comm_read for those that do; re-schedules the check if needed
 static
 void
-commHalfClosedCheck(void *) {
+commHalfClosedCheck(void *)
+{
     debugs(5, 5, HERE << "checking " << *TheHalfClosed);
 
     typedef DescriptorSet::const_iterator DSCI;
@@ -2452,13 +2486,15 @@ commHalfClosedCheck(void *) {
 /// checks whether we are waiting for possibly half-closed connection to close
 // We are monitoring if the read handler for the fd is the monitoring handler.
 bool
-commHasHalfClosedMonitor(int fd) {
+commHasHalfClosedMonitor(int fd)
+{
     return TheHalfClosed->has(fd);
 }
 
 /// stop waiting for possibly half-closed connection to close
 static void
-commStopHalfClosedMonitor(int const fd) {
+commStopHalfClosedMonitor(int const fd)
+{
     debugs(5, 5, HERE << "removing FD " << fd << " from " << *TheHalfClosed);
 
     // cancel the read if one was scheduled
@@ -2472,7 +2508,8 @@ commStopHalfClosedMonitor(int const fd) {
 
 /// I/O handler for the possibly half-closed connection monitoring code
 static void
-commHalfClosedReader(int fd, char *, size_t size, comm_err_t flag, int, void *) {
+commHalfClosedReader(int fd, char *, size_t size, comm_err_t flag, int, void *)
+{
     // there cannot be more data coming in on half-closed connections
     assert(size == 0);
     assert(commHasHalfClosedMonitor(fd)); // or we would have canceled the read
@@ -2504,7 +2541,8 @@ DeferredRead::DeferredRead () : theReader(NULL), theContext(NULL), theRead(), ca
 
 DeferredRead::DeferredRead (DeferrableRead *aReader, void *data, CommRead const &aRead) : theReader(aReader), theContext (data), theRead(aRead), cancelled(false) {}
 
-DeferredReadManager::~DeferredReadManager() {
+DeferredReadManager::~DeferredReadManager()
+{
     flushReads();
     assert (deferredReads.empty());
 }
@@ -2516,7 +2554,8 @@ template cbdata_type CbDataList<DeferredRead>::CBDATA_CbDataList;
 /// \endcond
 
 void
-DeferredReadManager::delayRead(DeferredRead const &aRead) {
+DeferredReadManager::delayRead(DeferredRead const &aRead)
+{
     debugs(5, 3, "Adding deferred read on FD " << aRead.theRead.fd);
     CbDataList<DeferredRead> *temp = deferredReads.push_back(aRead);
 
@@ -2531,7 +2570,8 @@ DeferredReadManager::delayRead(DeferredRead const &aRead) {
 }
 
 void
-DeferredReadManager::CloseHandler(int fd, void *thecbdata) {
+DeferredReadManager::CloseHandler(int fd, void *thecbdata)
+{
     if (!cbdataReferenceValid (thecbdata))
         return;
 
@@ -2542,7 +2582,8 @@ DeferredReadManager::CloseHandler(int fd, void *thecbdata) {
 }
 
 DeferredRead
-DeferredReadManager::popHead(CbDataListContainer<DeferredRead> &deferredReads) {
+DeferredReadManager::popHead(CbDataListContainer<DeferredRead> &deferredReads)
+{
     assert (!deferredReads.empty());
 
     DeferredRead &read = deferredReads.head->element;
@@ -2557,7 +2598,8 @@ DeferredReadManager::popHead(CbDataListContainer<DeferredRead> &deferredReads) {
 }
 
 void
-DeferredReadManager::kickReads(int const count) {
+DeferredReadManager::kickReads(int const count)
+{
     /* if we had CbDataList::size() we could consolidate this and flushReads */
 
     if (count < 1) {
@@ -2577,7 +2619,8 @@ DeferredReadManager::kickReads(int const count) {
 }
 
 void
-DeferredReadManager::flushReads() {
+DeferredReadManager::flushReads()
+{
     CbDataListContainer<DeferredRead> reads;
     reads = deferredReads;
     deferredReads = CbDataListContainer<DeferredRead>();
@@ -2590,7 +2633,8 @@ DeferredReadManager::flushReads() {
 }
 
 void
-DeferredReadManager::kickARead(DeferredRead const &aRead) {
+DeferredReadManager::kickARead(DeferredRead const &aRead)
+{
     if (aRead.cancelled)
         return;
 
@@ -2603,15 +2647,18 @@ DeferredReadManager::kickARead(DeferredRead const &aRead) {
 }
 
 void
-DeferredRead::markCancelled() {
+DeferredRead::markCancelled()
+{
     cancelled = true;
 }
 
-ConnectionDetail::ConnectionDetail() : me(), peer() {
+ConnectionDetail::ConnectionDetail() : me(), peer()
+{
 }
 
 int
-CommSelectEngine::checkEvents(int timeout) {
+CommSelectEngine::checkEvents(int timeout)
+{
     static time_t last_timeout = 0;
 
     /* No, this shouldn't be here. But it shouldn't be in each comm handler. -adrian */
index a14bf2524c98360245139eb87499737b663baebc..5e6f922eed0eca0a8364dd21e2cc24566b2ad75c 100644 (file)
@@ -4,7 +4,7 @@
 typedef enum {
     ERR_NONE,
 
-/* Access Permission Errors.  Prefix new with ERR_ACCESS_ */
+    /* Access Permission Errors.  Prefix new with ERR_ACCESS_ */
     ERR_ACCESS_DENIED,
     ERR_CACHE_ACCESS_DENIED,
     ERR_CACHE_MGR_ACCESS_DENIED,
@@ -12,7 +12,7 @@ typedef enum {
     ERR_NO_RELAY,
     ERR_CANNOT_FORWARD,
 
-/* TCP Errors. */
+    /* TCP Errors. */
     ERR_READ_TIMEOUT,
     ERR_LIFETIME_EXP,
     ERR_READ_ERROR,
@@ -21,11 +21,11 @@ typedef enum {
     ERR_SECURE_CONNECT_FAIL,
     ERR_SOCKET_FAILURE,
 
-/* DNS Errors */
+    /* DNS Errors */
     ERR_DNS_FAIL,
     ERR_URN_RESOLVE,
 
-/* HTTP Errors */
+    /* HTTP Errors */
     ERR_ONLY_IF_CACHED_MISS,    /* failure to satisfy only-if-cached request */
     ERR_TOO_BIG,
     ERR_INVALID_RESP,
@@ -35,7 +35,7 @@ typedef enum {
     ERR_INVALID_URL,
     ERR_ZERO_SIZE_OBJECT,
 
-/* FTP Errors */
+    /* FTP Errors */
     ERR_FTP_DISABLED,
     ERR_FTP_UNAVAILABLE,
     ERR_FTP_FAILURE,
@@ -45,13 +45,13 @@ typedef enum {
     ERR_FTP_PUT_CREATED,        /* !error,a note that the file was created */
     ERR_FTP_PUT_MODIFIED,       /* modified, !created */
 
-/* ESI Errors */
+    /* ESI Errors */
     ERR_ESI,                    /* Failure to perform ESI processing */
 
-/* ICAP Errors */
+    /* ICAP Errors */
     ERR_ICAP_FAILURE,
 
-/* Special Cases */
+    /* Special Cases */
     ERR_SQUID_SIGNATURE,        /* not really an error */
     ERR_SHUTTING_DOWN,
     TCP_RESET,
index 91c26ac0f400fd943de4477f60a4769b94a973be..b5d039d33ed8b5f39aaae0b2c146bb0b5d3bea96 100644 (file)
@@ -975,7 +975,7 @@ ErrorState::BuildContent()
                         *dt = '-';
                     else
 #endif
-                    *dt = xtolower(hdr[pos]);
+                        *dt = xtolower(hdr[pos]);
                     // valid codes only contain A-Z, hyphen (-) and *
                     if (*dt != '-' && *dt != '*' && (*dt < 'a' || *dt > 'z') )
                         invalid_byte = true;
index 8e7d5f9d919e26e027736129e6d7ae533b815987..db9181c2bad6d944d6ee264e74a1c4512581241b 100644 (file)
@@ -112,9 +112,9 @@ ESIVariableQuery::queryString() const
 }
 
 struct _query_elem const *
-            ESIVariableQuery::queryVector() const {
-        return query;
-    }
+ESIVariableQuery::queryVector() const {
+    return query;
+}
 
 size_t const &
 ESIVariableQuery::queryElements() const
index ca534a7688e93076d7f3d2bcc29990c79c944b78..2bdf6e38d5b60c49fdb831509e7473dcccafbcf2 100644 (file)
@@ -90,7 +90,8 @@
  * where structures of type fqdncache_entry whose most
  * interesting members are:
  */
-class fqdncache_entry {
+class fqdncache_entry
+{
 public:
     hash_link hash;            /* must be first */
     time_t lastref;
index 1f53b533938114438d2880d1274342cf1b63ae0d..eacd38004f4ea2d559eae196ee357e27245751e2 100644 (file)
@@ -1436,12 +1436,11 @@ FtpStateData::processReplyBody()
 
     if (flags.isdir) {
         parseListing();
-    } else
-        if (const int csize = data.readBuf->contentSize()) {
-            writeReplyBody(data.readBuf->content(), csize);
-            debugs(9, 5, HERE << "consuming " << csize << " bytes of readBuf");
-            data.readBuf->consume(csize);
-        }
+    } else if (const int csize = data.readBuf->contentSize()) {
+        writeReplyBody(data.readBuf->content(), csize);
+        debugs(9, 5, HERE << "consuming " << csize << " bytes of readBuf");
+        data.readBuf->consume(csize);
+    }
 
     entry->flush();
 
@@ -1497,8 +1496,7 @@ FtpStateData::checkAuth(const HttpHeader * req_hdr)
             xstrncpy(password, Config.Ftp.anon_user, MAX_URL);
             flags.tried_auth_anonymous=1;
             return 1;
-        }
-        else if (!flags.tried_auth_nopass) {
+        } else if (!flags.tried_auth_nopass) {
             xstrncpy(password, null_string, MAX_URL);
             flags.tried_auth_nopass=1;
             return 1;
@@ -2465,7 +2463,7 @@ ftpReadEPSV(FtpStateData* ftpState)
         /* server response with list of supported methods   */
         /*   522 Network protocol not supported, use (1)    */
         /*   522 Network protocol not supported, use (1,2)  */
-        /* TODO: handle the (1,2) case. We might get it back after EPSV ALL 
+        /* TODO: handle the (1,2) case. We might get it back after EPSV ALL
          * which means close data + control without self-destructing and re-open from scratch. */
         debugs(9, 5, HERE << "scanning: " << ftpState->ctrl.last_reply);
         buf = ftpState->ctrl.last_reply;
@@ -2494,8 +2492,7 @@ ftpReadEPSV(FtpStateData* ftpState)
             ftpState->state = SENT_EPSV_1;
             ftpSendPassive(ftpState);
 #endif
-        }
-        else {
+        } else {
             /* handle broken server (RFC 2428 says MUST specify supported protocols in 522) */
             debugs(9, DBG_IMPORTANT, "WARNING: Server at " << fd_table[ftpState->ctrl.fd].ipaddr << " sent unknown protocol negotiation hint: " << buf);
             ftpSendPassive(ftpState);
@@ -2642,8 +2639,7 @@ ftpSendPassive(FtpStateData * ftpState)
             snprintf(cbuf, 1024, "EPSV 1\r\n");
             ftpState->state = SENT_EPSV_1;
             break;
-        }
-        else if (ftpState->flags.epsv_all_sent) {
+        } else if (ftpState->flags.epsv_all_sent) {
             debugs(9, DBG_IMPORTANT, "FTP does not allow PASV method after 'EPSV ALL' has been sent.");
             ftpFail(ftpState);
             return;
index e3e926c63b011fc67eadf250011fd246772352ab..96be90fac9dedeb3245e43b7fff411f56d7d3d47 100644 (file)
@@ -46,8 +46,7 @@
 
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
 //MOVED:Debug.h    extern FILE *debug_log;             /* NULL */
index 1b5e8f62b9bce9834e2bcd07ee98518b34c099b4..244100c2bf42100f055e4ac8e2e5beeed7fdc7d0 100644 (file)
@@ -489,9 +489,9 @@ helperStatefulStats(StoreEntry * sentry, statefulhelper * hlp, const char *label
                           srv->flags.reserved ? 'R' : ' ',
                           srv->flags.shutdown ? 'S' : ' ',
                           srv->request ? (srv->request->placeholder ? 'P' : ' ') : ' ',
-                          tt < 0.0 ? 0.0 : tt,
-                          (int) srv->roffset,
-                          srv->request ? log_quote(srv->request->buf) : "(none)");
+                                  tt < 0.0 ? 0.0 : tt,
+                                  (int) srv->roffset,
+                                  srv->request ? log_quote(srv->request->buf) : "(none)");
     }
 
     storeAppendPrintf(sentry, "\nFlags key:\n\n");
@@ -608,8 +608,7 @@ helperStatefulShutdown(statefulhelper * hlp)
         if (srv->flags.reserved) {
             if (shutting_down) {
                 debugs(84, 3, "helperStatefulShutdown: " << hlp->id_name << " #" << srv->index + 1 << " is RESERVED. Closing anyway.");
-            }
-            else {
+            } else {
                 debugs(84, 3, "helperStatefulShutdown: " << hlp->id_name << " #" << srv->index + 1 << " is RESERVED. Not Shutting Down Yet.");
                 continue;
             }
@@ -999,7 +998,7 @@ helperStatefulHandleRead(int fd, char *buf, size_t len, comm_err_t flag, int xer
 
     if ((t = strchr(srv->rbuf, '\n'))) {
         /* end of reply found */
-       int called = 1;
+        int called = 1;
         debugs(84, 3, "helperStatefulHandleRead: end of reply found");
 
         if (t > srv->rbuf && t[-1] == '\r')
@@ -1011,7 +1010,7 @@ helperStatefulHandleRead(int fd, char *buf, size_t len, comm_err_t flag, int xer
             r->callback(r->data, srv, srv->rbuf);
         } else {
             debugs(84, 1, "StatefulHandleRead: no callback data registered");
-           called = 0;
+            called = 0;
         }
 
         srv->flags.busy = 0;
@@ -1025,15 +1024,15 @@ helperStatefulHandleRead(int fd, char *buf, size_t len, comm_err_t flag, int xer
                        tvSubMsec(srv->dispatch_time, current_time),
                        hlp->stats.replies, REDIRECT_AV_FACTOR);
 
-       if (called)
-           helperStatefulServerDone(srv);
-       else
-           helperStatefulReleaseServer(srv);
+        if (called)
+            helperStatefulServerDone(srv);
+        else
+            helperStatefulReleaseServer(srv);
     }
 
     if (srv->rfd != -1)
         comm_read(srv->rfd, srv->rbuf + srv->roffset, srv->rbuf_sz - srv->roffset - 1,
-              helperStatefulHandleRead, srv);
+                  helperStatefulHandleRead, srv);
 }
 
 static void
@@ -1295,7 +1294,7 @@ helperStatefulDispatch(helper_stateful_server * srv, helper_stateful_request * r
     if (!cbdataReferenceValid(r->data)) {
         debugs(84, 1, "helperStatefulDispatch: invalid callback data");
         helperStatefulRequestFree(r);
-       helperStatefulReleaseServer(srv);
+        helperStatefulReleaseServer(srv);
         return;
     }
 
index e946dbfb786a920bae51cdb06c2eb64122f3bd85..8eef8db54ca53b7b2d4a305809c248a94c654647 100644 (file)
@@ -76,8 +76,8 @@ static void copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeader
         HttpHeader * hdr_out, const int we_do_ranges, const http_state_flags);
 
 HttpStateData::HttpStateData(FwdState *theFwdState) : AsyncJob("HttpStateData"), ServerStateData(theFwdState),
-    lastChunk(0), header_bytes_read(0), reply_bytes_read(0),
-    body_bytes_truncated(0), httpChunkDecoder(NULL)
+        lastChunk(0), header_bytes_read(0), reply_bytes_read(0),
+        body_bytes_truncated(0), httpChunkDecoder(NULL)
 {
     debugs(11,5,HERE << "HttpStateData " << this << " created");
     ignoreCacheControl = false;
@@ -1150,13 +1150,12 @@ HttpStateData::continueAfterParsingHeader()
             const HttpVersion &v = vrep->sline.version;
             if (s == HTTP_INVALID_HEADER && v != HttpVersion(0,9)) {
                 error = ERR_INVALID_RESP;
-            } else
-                if (s == HTTP_HEADER_TOO_LARGE) {
-                    fwd->dontRetry(true);
-                    error = ERR_TOO_BIG;
-                } else {
-                    return true; // done parsing, got reply, and no error
-                }
+            } else if (s == HTTP_HEADER_TOO_LARGE) {
+                fwd->dontRetry(true);
+                error = ERR_TOO_BIG;
+            } else {
+                return true; // done parsing, got reply, and no error
+            }
         } else {
             // parsed headers but got no reply
             error = ERR_INVALID_RESP;
@@ -1188,14 +1187,14 @@ HttpStateData::truncateVirginBody()
         return; // no body or a body of unknown size, including chunked
 
     const int64_t body_bytes_read = reply_bytes_read - header_bytes_read;
-    if (body_bytes_read - body_bytes_truncated <= clen) 
+    if (body_bytes_read - body_bytes_truncated <= clen)
         return; // we did not read too much or already took care of the extras
 
     if (const int64_t extras = body_bytes_read - body_bytes_truncated - clen) {
         // server sent more that the advertised content length
-        debugs(11,5, HERE << "body_bytes_read=" << body_bytes_read << 
-            " clen=" << clen << '/' << vrep->content_length <<
-            " body_bytes_truncated=" << body_bytes_truncated << '+' << extras);
+        debugs(11,5, HERE << "body_bytes_read=" << body_bytes_read <<
+               " clen=" << clen << '/' << vrep->content_length <<
+               " body_bytes_truncated=" << body_bytes_truncated << '+' << extras);
 
         readBuf->truncate(extras);
         body_bytes_truncated += extras;
@@ -1422,7 +1421,7 @@ HttpStateData::sendComplete(const CommIoCbParams &io)
     commSetTimeout(fd, Config.Timeout.read, timeoutCall);
 
     flags.request_sent = 1;
-    
+
     orig_request->hier.peer_http_request_sent = current_time;
 }
 
index 997e49b4e672f8de1315094de3d981586a37c6d3..47aa203295d084d3fded2878caab8cdf943528e3 100644 (file)
@@ -140,7 +140,7 @@ IpAddress::GetCIDR() const
 
 #endif
 
-    for (;shift<sizeof(m_SocketAddr.sin6_addr) ;shift++) {
+    for (; shift<sizeof(m_SocketAddr.sin6_addr) ; shift++) {
         byte= *(ptr+shift);
 
         if (byte == 0xFF) {
@@ -1020,7 +1020,8 @@ char* IpAddress::NtoA(char* buf, const unsigned int blen, int force) const
     return buf;
 }
 
-unsigned int IpAddress::ToHostname(char *buf, const unsigned int blen) const {
+unsigned int IpAddress::ToHostname(char *buf, const unsigned int blen) const
+{
     char *p = buf;
 
     if (IsIPv6() && blen > 0) {
@@ -1050,7 +1051,8 @@ unsigned int IpAddress::ToHostname(char *buf, const unsigned int blen) const {
     return (p - buf);
 }
 
-char* IpAddress::ToURL(char* buf, unsigned int blen) const {
+char* IpAddress::ToURL(char* buf, unsigned int blen) const
+{
     char *p = buf;
 
     // Ensure we have a buffer.
@@ -1072,7 +1074,8 @@ char* IpAddress::ToURL(char* buf, unsigned int blen) const {
     return buf;
 }
 
-void IpAddress::GetSockAddr(struct sockaddr_storage &addr, const int family) const {
+void IpAddress::GetSockAddr(struct sockaddr_storage &addr, const int family) const
+{
     struct sockaddr_in *sin = NULL;
 
     if ( family == AF_INET && !IsIPv4()) {
@@ -1097,7 +1100,8 @@ void IpAddress::GetSockAddr(struct sockaddr_storage &addr, const int family) con
 #endif /* USE_IPV6 */
 }
 
-void IpAddress::GetSockAddr(struct sockaddr_in &buf) const {
+void IpAddress::GetSockAddr(struct sockaddr_in &buf) const
+{
 #if USE_IPV6
 
     if ( IsIPv4() ) {
@@ -1130,7 +1134,8 @@ void IpAddress::GetSockAddr(struct sockaddr_in &buf) const {
 
 #if USE_IPV6
 
-void IpAddress::GetSockAddr(struct sockaddr_in6 &buf) const {
+void IpAddress::GetSockAddr(struct sockaddr_in6 &buf) const
+{
     memcpy(&buf, &m_SocketAddr, sizeof(struct sockaddr_in6));
     /* maintain address family. It may have changed inside us. */
     buf.sin6_family = AF_INET6;
@@ -1145,7 +1150,8 @@ void IpAddress::GetSockAddr(struct sockaddr_in6 &buf) const {
 
 #if USE_IPV6
 
-void IpAddress::Map4to6(const struct in_addr &in, struct in6_addr &out) const {
+void IpAddress::Map4to6(const struct in_addr &in, struct in6_addr &out) const
+{
     /* check for special cases */
 
     if ( in.s_addr == 0x00000000) {
@@ -1169,7 +1175,8 @@ void IpAddress::Map4to6(const struct in_addr &in, struct in6_addr &out) const {
     }
 }
 
-void IpAddress::Map6to4(const struct in6_addr &in, struct in_addr &out) const {
+void IpAddress::Map6to4(const struct in6_addr &in, struct in_addr &out) const
+{
     /* ANYADDR */
     /* NOADDR */
     /* general */
@@ -1181,13 +1188,15 @@ void IpAddress::Map6to4(const struct in6_addr &in, struct in_addr &out) const {
 #endif
 
 #if USE_IPV6
-void IpAddress::GetInAddr(in6_addr &buf) const {
+void IpAddress::GetInAddr(in6_addr &buf) const
+{
     memcpy(&buf, &m_SocketAddr.sin6_addr, sizeof(struct in6_addr));
 }
 
 #endif
 
-bool IpAddress::GetInAddr(struct in_addr &buf) const {
+bool IpAddress::GetInAddr(struct in_addr &buf) const
+{
 
 #if USE_IPV6
     if ( IsIPv4() ) {
index a7f81e701031c18c4291eae5a98f6e7cf04b1eb6..5d1a336eb74fa8419ddaaab87d266b655750a942 100644 (file)
@@ -85,7 +85,8 @@
  * where structures of type ipcache_entry whose most
  * interesting members are:
  */
-class ipcache_entry {
+class ipcache_entry
+{
 public:
     hash_link hash;            /* must be first */
     time_t lastref;
@@ -656,7 +657,7 @@ ipcacheHandleReply(void *data, rfc1035_rr * answers, int na, const char *error_m
     IpcacheStats.replies++;
     const int age = i->age();
     statHistCount(&statCounter.dns.svc_time, age);
-                  
+
 #if USE_DNSSERVERS
 
     done = ipcacheParse(i, reply);
index d89ca8cb91bf07399361387b2422af9e08bc3119..554e4e4880e16a50e668eb400a6216adf2239f16 100644 (file)
@@ -717,7 +717,7 @@ mainReconfigureFinish(void *)
     enter_suid();              /* root to read config file */
 
     // we may have disabled the need for PURGE
-    if(Config2.onoff.enable_purge)
+    if (Config2.onoff.enable_purge)
         Config2.onoff.enable_purge = 2;
 
     parseConfigFile(ConfigFile);
@@ -959,7 +959,7 @@ mainInitialize(void)
 
     accessLogInit();
 
-#if ICAP_CLIENT    
+#if ICAP_CLIENT
     icapLogOpen();
 #endif
 
@@ -1118,7 +1118,7 @@ static int SquidMainSafe(int argc, char **argv);
 #if USE_WIN32_SERVICE
 /* When USE_WIN32_SERVICE is defined, the main function is placed in win32.cc */
 extern "C" void WINAPI
-    SquidWinSvcMain(int argc, char **argv)
+SquidWinSvcMain(int argc, char **argv)
 #else
 int
 main(int argc, char **argv)
index f694a07ad9da56a15449c8b8857710d87baf4be2..820ae355360311a2a21b0d174a7513c9a2240bf9 100644 (file)
@@ -748,23 +748,23 @@ SQUIDCEXTERN int SquidMain(int, char **);
 SQUIDCEXTERN int WIN32_pipe(int[2]);
 
 SQUIDCEXTERN int WIN32_getrusage(int, struct rusage *);
-            SQUIDCEXTERN void WIN32_ExceptionHandlerInit(void);
+SQUIDCEXTERN void WIN32_ExceptionHandlerInit(void);
 
-            SQUIDCEXTERN int Win32__WSAFDIsSet(int fd, fd_set* set);
-            SQUIDCEXTERN DWORD WIN32_IpAddrChangeMonitorInit();
+SQUIDCEXTERN int Win32__WSAFDIsSet(int fd, fd_set* set);
+SQUIDCEXTERN DWORD WIN32_IpAddrChangeMonitorInit();
 
 #endif
 
-            /* external_acl.c */
-            class external_acl;
-            SQUIDCEXTERN void parse_externalAclHelper(external_acl **);
+/* external_acl.c */
+class external_acl;
+        SQUIDCEXTERN void parse_externalAclHelper(external_acl **);
 
-            SQUIDCEXTERN void dump_externalAclHelper(StoreEntry * sentry, const char *name, const external_acl *);
+        SQUIDCEXTERN void dump_externalAclHelper(StoreEntry * sentry, const char *name, const external_acl *);
 
-            SQUIDCEXTERN void free_externalAclHelper(external_acl **);
+        SQUIDCEXTERN void free_externalAclHelper(external_acl **);
 
-            typedef void EAH(void *data, void *result);
-            class ACLChecklist;
+        typedef void EAH(void *data, void *result);
+        class ACLChecklist;
             SQUIDCEXTERN void externalAclLookup(ACLChecklist * ch, void *acl_data, EAH * handler, void *data);
 
             SQUIDCEXTERN void externalAclInit(void);
index 8fc7635cc012a3d38fa6e4097eea166cf1a0d3b7..d545548de064d228d3450cabfdac8b199b132552 100644 (file)
@@ -577,7 +577,7 @@ snmpConstructReponse(snmp_request_t * rq)
 
 static struct snmp_pdu *
 
-            snmpAgentResponse(struct snmp_pdu *PDU) {
+snmpAgentResponse(struct snmp_pdu *PDU) {
 
     struct snmp_pdu *Answer = NULL;
 
index 3293115179d4d399e75cdac54ad343497f1efd99..cb67d2cd272645bedbb854677a3265572165f425 100644 (file)
@@ -1536,7 +1536,7 @@ statCPUUsage(int minutes)
 }
 
 extern double
-    statRequestHitRatio(int minutes)
+statRequestHitRatio(int minutes)
 {
     assert(minutes < N_COUNT_HIST);
     return dpercent(CountHist[0].client_http.hits -
@@ -1546,7 +1546,7 @@ extern double
 }
 
 extern double
-    statRequestHitMemoryRatio(int minutes)
+statRequestHitMemoryRatio(int minutes)
 {
     assert(minutes < N_COUNT_HIST);
     return dpercent(CountHist[0].client_http.mem_hits -
@@ -1556,7 +1556,7 @@ extern double
 }
 
 extern double
-    statRequestHitDiskRatio(int minutes)
+statRequestHitDiskRatio(int minutes)
 {
     assert(minutes < N_COUNT_HIST);
     return dpercent(CountHist[0].client_http.disk_hits -
@@ -1566,7 +1566,7 @@ extern double
 }
 
 extern double
-    statByteHitRatio(int minutes)
+statByteHitRatio(int minutes)
 {
     size_t s;
     size_t c;
index 99531ef196d7074ef9c5c3cebe60996f7310c2d1..e16f869e78ab212523ad103fc0084837346b9d8c 100644 (file)
@@ -319,13 +319,13 @@ StoreEntry::storeClientType() const
 
         if (mem_obj->inmem_lo == 0 && !isEmpty()) {
             if (swap_status == SWAPOUT_DONE) {
-               if (mem_obj->endOffset() == mem_obj->object_sz) {
-                   /* hot object fully swapped in */
-                   return STORE_MEM_CLIENT;
-               }
+                if (mem_obj->endOffset() == mem_obj->object_sz) {
+                    /* hot object fully swapped in */
+                    return STORE_MEM_CLIENT;
+                }
             } else {
-               /* Memory-only, or currently being swapped out */
-               return STORE_MEM_CLIENT;
+                /* Memory-only, or currently being swapped out */
+                return STORE_MEM_CLIENT;
             }
         }
         return STORE_DISK_CLIENT;
@@ -1419,10 +1419,10 @@ StoreEntry::keepInMemory() const
         return 0;
 
     if (mem_obj->inmem_lo != 0)
-       return 0;
+        return 0;
 
     if (!Config.onoff.memory_cache_first && swap_status == SWAPOUT_DONE && refcount == 1)
-       return 0;
+        return 0;
 
     return 1;
 }
@@ -1844,10 +1844,10 @@ StoreEntry::trimMemory()
         return;
 
     if (!swapOutAble()) {
-       if (mem_obj->policyLowestOffsetToKeep(0) == 0) {
-           /* Nothing to do */
-           return;
-       }
+        if (mem_obj->policyLowestOffsetToKeep(0) == 0) {
+            /* Nothing to do */
+            return;
+        }
         /*
          * Its not swap-able, and we're about to delete a chunk,
          * so we must make it PRIVATE.  This is tricky/ugly because
index 61d18f8f5a3d7a851c978d6e878f0a74c7d066a5..39706e58fc0fb078c78e80adfeeaa89db8b7cf60 100644 (file)
@@ -474,7 +474,7 @@ store_client::fileRead()
 static void
 storeClientMemWriteComplete(void *data, StoreIOBuffer wroteBuffer)
 {
-        // Nothin to do here but callback is needed
+    // Nothin to do here but callback is needed
 }
 
 void
index e807b09d1784f6e45025c6f63bcfabed388159ae..9fa48e1bcfe23af6738b4c95f8bce6f8224b50e5 100644 (file)
@@ -268,7 +268,7 @@ struct SquidConfig {
 
         customlog *accesslogs;
 
-#if ICAP_CLIENT        
+#if ICAP_CLIENT
         customlog *icaplogs;
 #endif
 
index 6756f1e4878300bdd6c5b33532c2c80fd39b4f64..d6c5ffc356d9df35188b76093a84d483750ee729 100644 (file)
 StorePointer Store::CurrentRoot = NULL;
 
 extern "C" void
-    storeAppendPrintf(StoreEntry * e, const char *fmt,...)
+storeAppendPrintf(StoreEntry * e, const char *fmt,...)
 {
     fatal("storeAppendPrintf: Not implemented");
 }
 
 extern "C" void
-    storeAppendVPrintf(StoreEntry * e, const char *fmt, va_list vargs)
+storeAppendVPrintf(StoreEntry * e, const char *fmt, va_list vargs)
 {
     fatal("storeAppendVPrintf: Not implemented");
 }
index ce2121c6f77ef3bfb4105699dca133cd487a5904..012be6dc77961a23bed434122781c096593baa1b 100644 (file)
@@ -551,7 +551,7 @@ wccp2_add_service_list(int service, int service_id, int service_priority,
 }
 
 static struct wccp2_service_list_t *
-            wccp2_get_service_by_id(int service, int service_id) {
+wccp2_get_service_by_id(int service, int service_id) {
 
     struct wccp2_service_list_t *p;
 
index 6e048f3110b054aa3afa3d5f90d24191c9f5dcc5..42e56db945d9b0307960bc7fdfef7342746d3bbb 100644 (file)
@@ -1,6 +1,5 @@
 #define  DEFAULT_HASH_SIZE 7951
-extern "C"
-{
+extern "C" {
     typedef unsigned int HASHHASH(const void *, unsigned int);
     struct _hash_link {
         char *key;
index 9c1ea0005d47373855f710d1d41095e8ee90ac18..aff3fbfc04ca396abd1fe5bede555a739bbe0cbb 100644 (file)
@@ -298,7 +298,7 @@ reply_done(int fd, void *data)
 }
 
 struct _request *
-            request(char *urlin) {
+request(char *urlin) {
     int s = -1, f = -1;
     char buf[4096];
     char msg[8192];
index 39aa118968d4c774d203b6fabc7897da3b0baec6..d36e9935c7e73c9b517417e9c5761f925beb3129 100644 (file)
 #include <sys/select.h>
 #endif
 #if HAVE_FNMATCH_H
-extern "C"
-{
+extern "C" {
 #include <fnmatch.h>
 }
 #endif
@@ -880,7 +879,8 @@ process_request(cachemgr_request * req)
 }
 
 int
-main(int argc, char *argv[]) {
+main(int argc, char *argv[])
+{
     char *s;
     cachemgr_request *req;
 
@@ -912,7 +912,8 @@ main(int argc, char *argv[]) {
 }
 
 static char *
-read_post_request(void) {
+read_post_request(void)
+{
     char *s;
     char *buf;
     int len;
@@ -940,7 +941,8 @@ read_post_request(void) {
 }
 
 static char *
-read_get_request(void) {
+read_get_request(void)
+{
     char *s;
 
     if ((s = getenv("QUERY_STRING")) == NULL)
@@ -950,7 +952,8 @@ read_get_request(void) {
 }
 
 static cachemgr_request *
-read_request(void) {
+read_request(void)
+{
     char *buf;
 
     cachemgr_request *req;
@@ -1029,7 +1032,8 @@ read_request(void) {
  * Currently no powerful encryption is used.
  */
 static void
-make_pub_auth(cachemgr_request * req) {
+make_pub_auth(cachemgr_request * req)
+{
     static char buf[1024];
     safe_free(req->pub_auth);
     debug(3) fprintf(stderr, "cmgr: encoding for pub...\n");
@@ -1052,7 +1056,8 @@ make_pub_auth(cachemgr_request * req) {
 }
 
 static void
-decode_pub_auth(cachemgr_request * req) {
+decode_pub_auth(cachemgr_request * req)
+{
     char *buf;
     const char *host_name;
     const char *time_str;
@@ -1110,13 +1115,15 @@ decode_pub_auth(cachemgr_request * req) {
 }
 
 static void
-reset_auth(cachemgr_request * req) {
+reset_auth(cachemgr_request * req)
+{
     safe_free(req->passwd);
     safe_free(req->pub_auth);
 }
 
 static const char *
-make_auth_header(const cachemgr_request * req) {
+make_auth_header(const cachemgr_request * req)
+{
     static char buf[1024];
     size_t stringLength = 0;
     const char *str64;
@@ -1141,7 +1148,8 @@ make_auth_header(const cachemgr_request * req) {
 }
 
 static int
-check_target_acl(const char *hostname, int port) {
+check_target_acl(const char *hostname, int port)
+{
     char config_line[BUFSIZ];
     FILE *fp = NULL;
     int ret = 0;
index dd6e470a1a321d073235933ad727fca86e6c9db1..999648cecd68bf93fa59475b24845acb37e7adbd 100644 (file)
@@ -636,7 +636,8 @@ main(int argc, char *argv[])
 }
 
 static int
-client_comm_bind(int sock, const IpAddress &addr) {
+client_comm_bind(int sock, const IpAddress &addr)
+{
 
     int res;
 
@@ -654,7 +655,8 @@ client_comm_bind(int sock, const IpAddress &addr) {
 }
 
 static int
-client_comm_connect(int sock, const IpAddress &addr, struct timeval *tvp) {
+client_comm_connect(int sock, const IpAddress &addr, struct timeval *tvp)
+{
     int res;
     static struct addrinfo *AI = NULL;
 
@@ -673,7 +675,8 @@ client_comm_connect(int sock, const IpAddress &addr, struct timeval *tvp) {
 }
 
 static int
-Now(struct timeval *tp) {
+Now(struct timeval *tp)
+{
 #if GETTIMEOFDAY_NO_TZP
     return gettimeofday(tp);
 #else
@@ -683,18 +686,21 @@ Now(struct timeval *tp) {
 }                              /* ARGSUSED */
 
 static void
-catchSignal(int sig) {
+catchSignal(int sig)
+{
     interrupted = 1;
     fprintf(stderr, "Interrupted.\n");
 }
 
 static void
-pipe_handler(int sig) {
+pipe_handler(int sig)
+{
     fprintf(stderr, "SIGPIPE received.\n");
 }
 
 static void
-set_our_signal(void) {
+set_our_signal(void)
+{
 #if HAVE_SIGACTION
 
     struct sigaction sa;
@@ -714,7 +720,8 @@ set_our_signal(void) {
 }
 
 static ssize_t
-myread(int fd, void *buf, size_t len) {
+myread(int fd, void *buf, size_t len)
+{
 #ifndef _SQUID_MSWIN_
     alarm(io_timeout);
     return read(fd, buf, len);
@@ -725,7 +732,8 @@ myread(int fd, void *buf, size_t len) {
 }
 
 static ssize_t
-mywrite(int fd, void *buf, size_t len) {
+mywrite(int fd, void *buf, size_t len)
+{
 #ifndef _SQUID_MSWIN_
     alarm(io_timeout);
     return write(fd, buf, len);