From: Francesco Chemolli Date: Sun, 10 Feb 2013 16:31:40 +0000 (+0100) Subject: Turned remaining PortCfg flags to bool type X-Git-Tag: SQUID_3_4_0_1~292 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=86ab7a90f4612d3a457a64f9e580a83b0cc96540;p=thirdparty%2Fsquid.git Turned remaining PortCfg flags to bool type --- diff --git a/src/anyp/PortCfg.cc b/src/anyp/PortCfg.cc index 32e3ef003a..b645879699 100644 --- a/src/anyp/PortCfg.cc +++ b/src/anyp/PortCfg.cc @@ -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 diff --git a/src/anyp/PortCfg.h b/src/anyp/PortCfg.h index 43da576aa5..0898e45cdd 100644 --- a/src/anyp/PortCfg.h +++ b/src/anyp/PortCfg.h @@ -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; /** diff --git a/src/cache_cf.cc b/src/cache_cf.cc index d5b7ab5880..0d859973d8 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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) {