]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Turned remaining PortCfg flags to bool type
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 10 Feb 2013 16:31:40 +0000 (17:31 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 10 Feb 2013 16:31:40 +0000 (17:31 +0100)
src/anyp/PortCfg.cc
src/anyp/PortCfg.h
src/cache_cf.cc

index 32e3ef003a15778396ca1c2223e31b98804c0140..b645879699b6508e2deac4b524ac37102e99302a 100644 (file)
@@ -64,8 +64,7 @@ AnyP::PortCfg::clone() const
     b->vport = vport;
     b->connection_auth_disabled = connection_auth_disabled;
     b->disable_pmtu_discovery = disable_pmtu_discovery;
-
-    memcpy( &(b->tcp_keepalive), &(tcp_keepalive), sizeof(tcp_keepalive));
+    b->tcp_keepalive = tcp_keepalive;
 
 #if 0
     // AYJ: 2009-07-18: for now SSL does not clone. Configure separate ports with IPs and SSL settings
index 43da576aa55bbd7600028d4a1f11a282bd2c514d..0898e45cdda6ac7c5472f721d6dfae0c01420c77 100644 (file)
@@ -32,20 +32,21 @@ public:
 
     TrafficMode flags;  ///< flags indicating what type of traffic to expect via this port.
 
-    unsigned int allow_direct:1;       /**< Allow direct forwarding in accelerator mode */
-    unsigned int vhost:1;              /**< uses host header */
-    unsigned int actAsOrigin:1;        ///< update replies to conform with RFC 2616
-    unsigned int ignore_cc:1;          /**< Ignore request Cache-Control directives */
+    bool allow_direct;       ///< Allow direct forwarding in accelerator mode
+    bool vhost;              ///< uses host header
+    bool actAsOrigin;        ///< update replies to conform with RFC 2616
+    bool ignore_cc;          ///< Ignore request Cache-Control directives
 
-    int vport;                 /* virtual port support, -1 for dynamic, >0 static*/
-    bool connection_auth_disabled;     /* Don't support connection oriented auth */
+    bool connection_auth_disabled; ///< Don't support connection oriented auth
+
+    int vport;               ///< virtual port support. -1 if dynamic, >0 static
     int disable_pmtu_discovery;
 
     struct {
-        unsigned int enabled;
         unsigned int idle;
         unsigned int interval;
         unsigned int timeout;
+        bool enabled;
     } tcp_keepalive;
 
     /**
index d5b7ab588029fde6d5f142c2458f0b2fc27922d6..0d859973d8125b5834274dd6b3458ed5f6775027 100644 (file)
@@ -3578,7 +3578,7 @@ parse_port_option(AnyP::PortCfg * s, char *token)
             self_destruct();
         }
         s->flags.accelSurrogate = true;
-        s->vhost = 1;
+        s->vhost = true;
     } else if (strcmp(token, "transparent") == 0 || strcmp(token, "intercept") == 0) {
         if (s->flags.accelSurrogate || s->flags.tproxyIntercept) {
             debugs(3, DBG_CRITICAL, "FATAL: http(s)_port: Intercept mode requires its own interception port. It cannot be shared with other modes.");
@@ -3625,12 +3625,12 @@ parse_port_option(AnyP::PortCfg * s, char *token)
             debugs(3, DBG_CRITICAL, "WARNING: http(s)_port: vhost option is deprecated. Use 'accel' mode flag instead.");
         }
         s->flags.accelSurrogate = true;
-        s->vhost = 1;
+        s->vhost = true;
     } else if (strcmp(token, "no-vhost") == 0) {
         if (!s->flags.accelSurrogate) {
             debugs(3, DBG_IMPORTANT, "ERROR: http(s)_port: no-vhost option requires Acceleration mode flag.");
         }
-        s->vhost = 0;
+        s->vhost = false;
     } else if (strcmp(token, "vport") == 0) {
         if (!s->flags.accelSurrogate) {
             debugs(3, DBG_CRITICAL, "FATAL: http(s)_port: vport option requires Acceleration mode flag.");
@@ -3654,12 +3654,12 @@ parse_port_option(AnyP::PortCfg * s, char *token)
             debugs(3, DBG_CRITICAL, "FATAL: http(s)_port: allow-direct option requires Acceleration mode flag.");
             self_destruct();
         }
-        s->allow_direct = 1;
+        s->allow_direct = true;
     } else if (strcmp(token, "act-as-origin") == 0) {
         if (!s->flags.accelSurrogate) {
             debugs(3, DBG_IMPORTANT, "ERROR: http(s)_port: act-as-origin option requires Acceleration mode flag.");
         } else
-            s->actAsOrigin = 1;
+            s->actAsOrigin = true;
     } else if (strcmp(token, "ignore-cc") == 0) {
 #if !USE_HTTP_VIOLATIONS
         if (!s->flags.accelSurrogate) {
@@ -3667,7 +3667,7 @@ parse_port_option(AnyP::PortCfg * s, char *token)
             self_destruct();
         }
 #endif
-        s->ignore_cc = 1;
+        s->ignore_cc = true;
     } else if (strncmp(token, "name=", 5) == 0) {
         safe_free(s->name);
         s->name = xstrdup(token + 5);
@@ -3694,10 +3694,10 @@ parse_port_option(AnyP::PortCfg * s, char *token)
             self_destruct();
         }
     } else if (strcmp(token, "tcpkeepalive") == 0) {
-        s->tcp_keepalive.enabled = 1;
+        s->tcp_keepalive.enabled = true;
     } else if (strncmp(token, "tcpkeepalive=", 13) == 0) {
         char *t = token + 13;
-        s->tcp_keepalive.enabled = 1;
+        s->tcp_keepalive.enabled = true;
         s->tcp_keepalive.idle = xatoui(t);
         t = strchr(t, ',');
         if (t) {