if (err)
*err = NULL;
- if (!strcmp(*args, "if")) {
+ if (strcmp(*args, "if") == 0) {
pol = ACL_COND_IF;
args++;
}
- else if (!strcmp(*args, "unless")) {
+ else if (strcmp(*args, "unless") == 0) {
pol = ACL_COND_UNLESS;
args++;
}
list_for_each_entry(acl, &p->acl, list) {
list_for_each_entry(expr, &acl->expr, list) {
- if (!strcmp(expr->kw, "http_auth_group")) {
+ if (strcmp(expr->kw, "http_auth_group") == 0) {
/* Note: the ARGT_USR argument may only have been resolved earlier
* by smp_resolve_args().
*/
const char *res;
const char *timeout_name = args[idx++];
- if (!strcmp(timeout_name, "server")) {
+ if (strcmp(timeout_name, "server") == 0) {
*name = ACT_TIMEOUT_SERVER;
}
- else if (!strcmp(timeout_name, "tunnel")) {
+ else if (strcmp(timeout_name, "tunnel") == 0) {
*name = ACT_TIMEOUT_TUNNEL;
}
else {
return NULL;
for (l = userlist; l; l = l->next)
- if (!strcmp(l->name, name))
+ if (strcmp(l->name, name) == 0)
return l;
return NULL;
while ((group = strtok(group?NULL:curuser->u.groups_names, ","))) {
for (ag = curuserlist->groups; ag; ag = ag->next) {
- if (!strcmp(ag->name, group))
+ if (strcmp(ag->name, group) == 0)
break;
}
while ((user = strtok(user?NULL:ag->groupusers, ","))) {
for (curuser = curuserlist->users; curuser; curuser = curuser->next) {
- if (!strcmp(curuser->user, user))
+ if (strcmp(curuser->user, user) == 0)
break;
}
#endif
for (u = ul->users; u; u = u->next)
- if (!strcmp(user, u->user))
+ if (strcmp(user, u->user) == 0)
break;
if (!u)
return 0;
}
- if (!strcmp(args[0], "roundrobin")) {
+ if (strcmp(args[0], "roundrobin") == 0) {
curproxy->lbprm.algo &= ~BE_LB_ALGO;
curproxy->lbprm.algo |= BE_LB_ALGO_RR;
}
- else if (!strcmp(args[0], "static-rr")) {
+ else if (strcmp(args[0], "static-rr") == 0) {
curproxy->lbprm.algo &= ~BE_LB_ALGO;
curproxy->lbprm.algo |= BE_LB_ALGO_SRR;
}
- else if (!strcmp(args[0], "first")) {
+ else if (strcmp(args[0], "first") == 0) {
curproxy->lbprm.algo &= ~BE_LB_ALGO;
curproxy->lbprm.algo |= BE_LB_ALGO_FAS;
}
- else if (!strcmp(args[0], "leastconn")) {
+ else if (strcmp(args[0], "leastconn") == 0) {
curproxy->lbprm.algo &= ~BE_LB_ALGO;
curproxy->lbprm.algo |= BE_LB_ALGO_LC;
}
}
}
}
- else if (!strcmp(args[0], "source")) {
+ else if (strcmp(args[0], "source") == 0) {
curproxy->lbprm.algo &= ~BE_LB_ALGO;
curproxy->lbprm.algo |= BE_LB_ALGO_SH;
}
- else if (!strcmp(args[0], "uri")) {
+ else if (strcmp(args[0], "uri") == 0) {
int arg = 1;
curproxy->lbprm.algo &= ~BE_LB_ALGO;
curproxy->lbprm.arg_opt3 = 0; // "depth"
while (*args[arg]) {
- if (!strcmp(args[arg], "len")) {
+ if (strcmp(args[arg], "len") == 0) {
if (!*args[arg+1] || (atoi(args[arg+1]) <= 0)) {
memprintf(err, "%s : '%s' expects a positive integer (got '%s').", args[0], args[arg], args[arg+1]);
return -1;
curproxy->lbprm.arg_opt2 = atoi(args[arg+1]);
arg += 2;
}
- else if (!strcmp(args[arg], "depth")) {
+ else if (strcmp(args[arg], "depth") == 0) {
if (!*args[arg+1] || (atoi(args[arg+1]) <= 0)) {
memprintf(err, "%s : '%s' expects a positive integer (got '%s').", args[0], args[arg], args[arg+1]);
return -1;
curproxy->lbprm.arg_opt3 = atoi(args[arg+1]) + 1;
arg += 2;
}
- else if (!strcmp(args[arg], "whole")) {
+ else if (strcmp(args[arg], "whole") == 0) {
curproxy->lbprm.arg_opt1 |= 1;
arg += 1;
}
- else if (!strcmp(args[arg], "path-only")) {
+ else if (strcmp(args[arg], "path-only") == 0) {
curproxy->lbprm.arg_opt1 |= 2;
arg += 1;
}
}
}
}
- else if (!strcmp(args[0], "url_param")) {
+ else if (strcmp(args[0], "url_param") == 0) {
if (!*args[1]) {
memprintf(err, "%s requires an URL parameter name.", args[0]);
return -1;
curproxy->lbprm.arg_str = strdup(args[1]);
curproxy->lbprm.arg_len = strlen(args[1]);
if (*args[2]) {
- if (strcmp(args[2], "check_post")) {
+ if (strcmp(args[2], "check_post") != 0) {
memprintf(err, "%s only accepts 'check_post' modifier (got '%s').", args[0], args[2]);
return -1;
}
curproxy->lbprm.arg_opt1 = 0;
if (*args[1]) {
- if (strcmp(args[1], "use_domain_only")) {
+ if (strcmp(args[1], "use_domain_only") != 0) {
memprintf(err, "%s only accepts 'use_domain_only' modifier (got '%s').", args[0], args[1]);
return -1;
}
* post_check.
*/
list_for_each_entry(cache, &caches_config, list) {
- if (!strcmp(cache->id, cconf->c.name))
+ if (strcmp(cache->id, cconf->c.name) == 0)
goto found;
}
list_for_each_entry(fconf, &proxy->filter_configs, list) {
if (fconf->id == cache_store_flt_id) {
cconf = fconf->conf;
- if (cconf && !strcmp((char *)cconf->c.name, name)) {
+ if (cconf && strcmp((char *)cconf->c.name, name) == 0) {
rule->arg.act.p[0] = cconf;
return 1;
}
continue;
cconf = fconf->conf;
- if (!strcmp(cache->id, cconf->c.name)) {
+ if (strcmp(cache->id, cconf->c.name) == 0) {
free(cconf->c.name);
cconf->flags |= CACHE_FLT_INIT;
cconf->c.cache = cache;
continue;
cconf = f->conf;
- if (strcmp(name, cconf->c.name)) {
+ if (strcmp(name, cconf->c.name) != 0) {
cconf = NULL;
continue;
}
int err_code = 0;
char *errmsg = NULL;
- if (!strcmp(args[0], "global")) { /* new section */
+ if (strcmp(args[0], "global") == 0) { /* new section */
/* no option, nothing special to do */
alertif_too_many_args(0, file, linenum, args, &err_code);
goto out;
}
- else if (!strcmp(args[0], "daemon")) {
+ else if (strcmp(args[0], "daemon") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.mode |= MODE_DAEMON;
}
- else if (!strcmp(args[0], "master-worker")) {
+ else if (strcmp(args[0], "master-worker") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*args[1]) {
- if (!strcmp(args[1], "no-exit-on-failure")) {
+ if (strcmp(args[1], "no-exit-on-failure") == 0) {
global.tune.options |= GTUNE_NOEXIT_ONFAILURE;
} else {
ha_alert("parsing [%s:%d] : '%s' only supports 'no-exit-on-failure' option.\n", file, linenum, args[0]);
}
global.mode |= MODE_MWORKER;
}
- else if (!strcmp(args[0], "noepoll")) {
+ else if (strcmp(args[0], "noepoll") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.tune.options &= ~GTUNE_USE_EPOLL;
}
- else if (!strcmp(args[0], "nokqueue")) {
+ else if (strcmp(args[0], "nokqueue") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.tune.options &= ~GTUNE_USE_KQUEUE;
}
- else if (!strcmp(args[0], "noevports")) {
+ else if (strcmp(args[0], "noevports") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.tune.options &= ~GTUNE_USE_EVPORTS;
}
- else if (!strcmp(args[0], "nopoll")) {
+ else if (strcmp(args[0], "nopoll") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.tune.options &= ~GTUNE_USE_POLL;
}
- else if (!strcmp(args[0], "busy-polling")) { /* "no busy-polling" or "busy-polling" */
+ else if (strcmp(args[0], "busy-polling") == 0) { /* "no busy-polling" or "busy-polling" */
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
if (kwm == KWM_NO)
else
global.tune.options |= GTUNE_BUSY_POLLING;
}
- else if (!strcmp(args[0], "set-dumpable")) { /* "no set-dumpable" or "set-dumpable" */
+ else if (strcmp(args[0], "set-dumpable") == 0) { /* "no set-dumpable" or "set-dumpable" */
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
if (kwm == KWM_NO)
else
global.tune.options |= GTUNE_SET_DUMPABLE;
}
- else if (!strcmp(args[0], "insecure-fork-wanted")) { /* "no insecure-fork-wanted" or "insecure-fork-wanted" */
+ else if (strcmp(args[0], "insecure-fork-wanted") == 0) { /* "no insecure-fork-wanted" or "insecure-fork-wanted" */
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
if (kwm == KWM_NO)
else
global.tune.options |= GTUNE_INSECURE_FORK;
}
- else if (!strcmp(args[0], "insecure-setuid-wanted")) { /* "no insecure-setuid-wanted" or "insecure-setuid-wanted" */
+ else if (strcmp(args[0], "insecure-setuid-wanted") == 0) { /* "no insecure-setuid-wanted" or "insecure-setuid-wanted" */
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
if (kwm == KWM_NO)
else
global.tune.options |= GTUNE_INSECURE_SETUID;
}
- else if (!strcmp(args[0], "nosplice")) {
+ else if (strcmp(args[0], "nosplice") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.tune.options &= ~GTUNE_USE_SPLICE;
}
- else if (!strcmp(args[0], "nogetaddrinfo")) {
+ else if (strcmp(args[0], "nogetaddrinfo") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.tune.options &= ~GTUNE_USE_GAI;
}
- else if (!strcmp(args[0], "noreuseport")) {
+ else if (strcmp(args[0], "noreuseport") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.tune.options &= ~GTUNE_USE_REUSEPORT;
}
- else if (!strcmp(args[0], "quiet")) {
+ else if (strcmp(args[0], "quiet") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.mode |= MODE_QUIET;
}
- else if (!strcmp(args[0], "zero-warning")) {
+ else if (strcmp(args[0], "zero-warning") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.mode |= MODE_ZERO_WARNING;
}
- else if (!strcmp(args[0], "tune.runqueue-depth")) {
+ else if (strcmp(args[0], "tune.runqueue-depth") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.tune.runqueue_depth != 0) {
global.tune.runqueue_depth = atol(args[1]);
}
- else if (!strcmp(args[0], "tune.maxpollevents")) {
+ else if (strcmp(args[0], "tune.maxpollevents") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.tune.maxpollevents != 0) {
}
global.tune.maxpollevents = atol(args[1]);
}
- else if (!strcmp(args[0], "tune.maxaccept")) {
+ else if (strcmp(args[0], "tune.maxaccept") == 0) {
long max;
if (alertif_too_many_args(1, file, linenum, args, &err_code))
}
global.tune.maxaccept = max;
}
- else if (!strcmp(args[0], "tune.chksize")) {
+ else if (strcmp(args[0], "tune.chksize") == 0) {
ha_warning("parsing [%s:%d]: the option '%s' is deprecated and will be removed in next version.\n",
file, linenum, args[0]);
}
- else if (!strcmp(args[0], "tune.recv_enough")) {
+ else if (strcmp(args[0], "tune.recv_enough") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
}
global.tune.recv_enough = atol(args[1]);
}
- else if (!strcmp(args[0], "tune.buffers.limit")) {
+ else if (strcmp(args[0], "tune.buffers.limit") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
global.tune.buf_limit = global.tune.reserved_bufs + 1;
}
}
- else if (!strcmp(args[0], "tune.buffers.reserve")) {
+ else if (strcmp(args[0], "tune.buffers.reserve") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
if (global.tune.buf_limit && global.tune.buf_limit <= global.tune.reserved_bufs)
global.tune.buf_limit = global.tune.reserved_bufs + 1;
}
- else if (!strcmp(args[0], "tune.bufsize")) {
+ else if (strcmp(args[0], "tune.bufsize") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
goto out;
}
}
- else if (!strcmp(args[0], "tune.maxrewrite")) {
+ else if (strcmp(args[0], "tune.maxrewrite") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
goto out;
}
}
- else if (!strcmp(args[0], "tune.idletimer")) {
+ else if (strcmp(args[0], "tune.idletimer") == 0) {
unsigned int idle;
const char *res;
}
global.tune.idle_timer = idle;
}
- else if (!strcmp(args[0], "tune.rcvbuf.client")) {
+ else if (strcmp(args[0], "tune.rcvbuf.client") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.tune.client_rcvbuf != 0) {
}
global.tune.client_rcvbuf = atol(args[1]);
}
- else if (!strcmp(args[0], "tune.rcvbuf.server")) {
+ else if (strcmp(args[0], "tune.rcvbuf.server") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.tune.server_rcvbuf != 0) {
}
global.tune.server_rcvbuf = atol(args[1]);
}
- else if (!strcmp(args[0], "tune.sndbuf.client")) {
+ else if (strcmp(args[0], "tune.sndbuf.client") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.tune.client_sndbuf != 0) {
}
global.tune.client_sndbuf = atol(args[1]);
}
- else if (!strcmp(args[0], "tune.sndbuf.server")) {
+ else if (strcmp(args[0], "tune.sndbuf.server") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.tune.server_sndbuf != 0) {
}
global.tune.server_sndbuf = atol(args[1]);
}
- else if (!strcmp(args[0], "tune.pipesize")) {
+ else if (strcmp(args[0], "tune.pipesize") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
}
global.tune.pipesize = atol(args[1]);
}
- else if (!strcmp(args[0], "tune.http.cookielen")) {
+ else if (strcmp(args[0], "tune.http.cookielen") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
}
global.tune.cookie_len = atol(args[1]) + 1;
}
- else if (!strcmp(args[0], "tune.http.logurilen")) {
+ else if (strcmp(args[0], "tune.http.logurilen") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
}
global.tune.requri_len = atol(args[1]) + 1;
}
- else if (!strcmp(args[0], "tune.http.maxhdr")) {
+ else if (strcmp(args[0], "tune.http.maxhdr") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
goto out;
}
}
- else if (!strcmp(args[0], "tune.comp.maxlevel")) {
+ else if (strcmp(args[0], "tune.comp.maxlevel") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*args[1]) {
goto out;
}
}
- else if (!strcmp(args[0], "tune.pattern.cache-size")) {
+ else if (strcmp(args[0], "tune.pattern.cache-size") == 0) {
if (*args[1]) {
global.tune.pattern_cache = atoi(args[1]);
if (global.tune.pattern_cache < 0) {
goto out;
}
}
- else if (!strcmp(args[0], "uid")) {
+ else if (strcmp(args[0], "uid") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.uid != 0) {
}
}
- else if (!strcmp(args[0], "gid")) {
+ else if (strcmp(args[0], "gid") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.gid != 0) {
goto out;
}
}
- else if (!strcmp(args[0], "external-check")) {
+ else if (strcmp(args[0], "external-check") == 0) {
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
global.external_check = 1;
}
/* user/group name handling */
- else if (!strcmp(args[0], "user")) {
+ else if (strcmp(args[0], "user") == 0) {
struct passwd *ha_user;
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
err_code |= ERR_ALERT | ERR_FATAL;
}
}
- else if (!strcmp(args[0], "group")) {
+ else if (strcmp(args[0], "group") == 0) {
struct group *ha_group;
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
}
}
/* end of user/group name handling*/
- else if (!strcmp(args[0], "nbproc")) {
+ else if (strcmp(args[0], "nbproc") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
goto out;
}
}
- else if (!strcmp(args[0], "nbthread")) {
+ else if (strcmp(args[0], "nbthread") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
goto out;
}
}
- else if (!strcmp(args[0], "maxconn")) {
+ else if (strcmp(args[0], "maxconn") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.maxconn != 0) {
}
#endif /* SYSTEM_MAXCONN */
}
- else if (!strcmp(args[0], "ssl-server-verify")) {
+ else if (strcmp(args[0], "ssl-server-verify") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
goto out;
}
}
- else if (!strcmp(args[0], "maxconnrate")) {
+ else if (strcmp(args[0], "maxconnrate") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.cps_lim != 0) {
}
global.cps_lim = atol(args[1]);
}
- else if (!strcmp(args[0], "maxsessrate")) {
+ else if (strcmp(args[0], "maxsessrate") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.sps_lim != 0) {
}
global.sps_lim = atol(args[1]);
}
- else if (!strcmp(args[0], "maxsslrate")) {
+ else if (strcmp(args[0], "maxsslrate") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.ssl_lim != 0) {
}
global.ssl_lim = atol(args[1]);
}
- else if (!strcmp(args[0], "maxcomprate")) {
+ else if (strcmp(args[0], "maxcomprate") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
}
global.comp_rate_lim = atoi(args[1]) * 1024;
}
- else if (!strcmp(args[0], "maxpipes")) {
+ else if (strcmp(args[0], "maxpipes") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.maxpipes != 0) {
}
global.maxpipes = atol(args[1]);
}
- else if (!strcmp(args[0], "maxzlibmem")) {
+ else if (strcmp(args[0], "maxzlibmem") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
}
global.maxzlibmem = atol(args[1]) * 1024L * 1024L;
}
- else if (!strcmp(args[0], "maxcompcpuusage")) {
+ else if (strcmp(args[0], "maxcompcpuusage") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
}
}
- else if (!strcmp(args[0], "ulimit-n")) {
+ else if (strcmp(args[0], "ulimit-n") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.rlimit_nofile != 0) {
}
global.rlimit_nofile = atol(args[1]);
}
- else if (!strcmp(args[0], "chroot")) {
+ else if (strcmp(args[0], "chroot") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.chroot != NULL) {
}
global.chroot = strdup(args[1]);
}
- else if (!strcmp(args[0], "description")) {
+ else if (strcmp(args[0], "description") == 0) {
int i, len=0;
char *d;
for (i = 2; *args[i]; i++)
d += snprintf(d, global.desc + len - d, " %s", args[i]);
}
- else if (!strcmp(args[0], "node")) {
+ else if (strcmp(args[0], "node") == 0) {
int i;
char c;
global.node = strdup(args[1]);
}
- else if (!strcmp(args[0], "pidfile")) {
+ else if (strcmp(args[0], "pidfile") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.pidfile != NULL) {
}
global.pidfile = strdup(args[1]);
}
- else if (!strcmp(args[0], "unix-bind")) {
+ else if (strcmp(args[0], "unix-bind") == 0) {
int cur_arg = 1;
while (*(args[cur_arg])) {
- if (!strcmp(args[cur_arg], "prefix")) {
+ if (strcmp(args[cur_arg], "prefix") == 0) {
if (global.unix_bind.prefix != NULL) {
ha_alert("parsing [%s:%d] : unix-bind '%s' already specified. Continuing.\n", file, linenum, args[cur_arg]);
err_code |= ERR_ALERT;
continue;
}
- if (!strcmp(args[cur_arg], "mode")) {
+ if (strcmp(args[cur_arg], "mode") == 0) {
global.unix_bind.ux.mode = strtol(args[cur_arg + 1], NULL, 8);
cur_arg += 2;
continue;
}
- if (!strcmp(args[cur_arg], "uid")) {
+ if (strcmp(args[cur_arg], "uid") == 0) {
global.unix_bind.ux.uid = atol(args[cur_arg + 1 ]);
cur_arg += 2;
continue;
}
- if (!strcmp(args[cur_arg], "gid")) {
+ if (strcmp(args[cur_arg], "gid") == 0) {
global.unix_bind.ux.gid = atol(args[cur_arg + 1 ]);
cur_arg += 2;
continue;
}
- if (!strcmp(args[cur_arg], "user")) {
+ if (strcmp(args[cur_arg], "user") == 0) {
struct passwd *user;
user = getpwnam(args[cur_arg + 1]);
continue;
}
- if (!strcmp(args[cur_arg], "group")) {
+ if (strcmp(args[cur_arg], "group") == 0) {
struct group *group;
group = getgrnam(args[cur_arg + 1]);
goto out;
}
}
- else if (!strcmp(args[0], "log")) { /* "no log" or "log ..." */
+ else if (strcmp(args[0], "log") == 0) { /* "no log" or "log ..." */
if (!parse_logsrv(args, &global.logsrvs, (kwm == KWM_NO), &errmsg)) {
ha_alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
}
- else if (!strcmp(args[0], "log-send-hostname")) { /* set the hostname in syslog header */
+ else if (strcmp(args[0], "log-send-hostname") == 0) { /* set the hostname in syslog header */
char *name;
if (global.log_send_hostname != NULL) {
free(global.log_send_hostname);
global.log_send_hostname = strdup(name);
}
- else if (!strcmp(args[0], "server-state-base")) { /* path base where HAProxy can find server state files */
+ else if (strcmp(args[0], "server-state-base") == 0) { /* path base where HAProxy can find server state files */
if (global.server_state_base != NULL) {
ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]);
err_code |= ERR_ALERT;
global.server_state_base = strdup(args[1]);
}
- else if (!strcmp(args[0], "server-state-file")) { /* path to the file where HAProxy can load the server states */
+ else if (strcmp(args[0], "server-state-file") == 0) { /* path to the file where HAProxy can load the server states */
if (global.server_state_file != NULL) {
ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]);
err_code |= ERR_ALERT;
global.server_state_file = strdup(args[1]);
}
- else if (!strcmp(args[0], "log-tag")) { /* tag to report to syslog */
+ else if (strcmp(args[0], "log-tag") == 0) { /* tag to report to syslog */
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (*(args[1]) == 0) {
goto out;
}
}
- else if (!strcmp(args[0], "spread-checks")) { /* random time between checks (0-50) */
+ else if (strcmp(args[0], "spread-checks") == 0) { /* random time between checks (0-50) */
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (global.spread_checks != 0) {
err_code |= ERR_ALERT | ERR_FATAL;
}
}
- else if (!strcmp(args[0], "max-spread-checks")) { /* maximum time between first and last check */
+ else if (strcmp(args[0], "max-spread-checks") == 0) { /* maximum time between first and last check */
const char *err;
unsigned int val;
goto out;
}
}
- else if (!strcmp(args[0], "unsetenv")) {
+ else if (strcmp(args[0], "unsetenv") == 0) {
int arg;
if (*(args[1]) == 0) {
}
}
}
- else if (!strcmp(args[0], "resetenv")) {
+ else if (strcmp(args[0], "resetenv") == 0) {
extern char **environ;
char **env = environ;
env++;
}
}
- else if (!strcmp(args[0], "strict-limits")) { /* "no strict-limits" or "strict-limits" */
+ else if (strcmp(args[0], "strict-limits") == 0) { /* "no strict-limits" or "strict-limits" */
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
if (kwm == KWM_NO)
global.tune.options &= ~GTUNE_STRICT_LIMITS;
}
- else if (!strcmp(args[0], "localpeer")) {
+ else if (strcmp(args[0], "localpeer") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
char *errmsg = NULL;
struct bind_conf *bind_conf;
- if (!strcmp(args[0], "listen"))
+ if (strcmp(args[0], "listen") == 0)
rc = PR_CAP_LISTEN;
- else if (!strcmp(args[0], "frontend"))
+ else if (strcmp(args[0], "frontend") == 0)
rc = PR_CAP_FE;
- else if (!strcmp(args[0], "backend"))
+ else if (strcmp(args[0], "backend") == 0)
rc = PR_CAP_BE;
else
rc = PR_CAP_NONE;
goto out;
}
- else if (!strcmp(args[0], "defaults")) { /* use this one to assign default values */
+ else if (strcmp(args[0], "defaults") == 0) { /* use this one to assign default values */
/* some variables may have already been initialized earlier */
/* FIXME-20070101: we should do this too at the end of the
* config parsing to free all default values.
curproxy->conf.args.line = linenum;
/* Now let's parse the proxy-specific keywords */
- if (!strcmp(args[0], "server") ||
- !strcmp(args[0], "default-server") ||
- !strcmp(args[0], "server-template")) {
+ if (strcmp(args[0], "server") == 0 ||
+ strcmp(args[0], "default-server") == 0 ||
+ strcmp(args[0], "server-template") == 0) {
err_code |= parse_server(file, linenum, args, curproxy, &defproxy, 1, 0, 0);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[0], "bind")) { /* new listen addresses */
+ else if (strcmp(args[0], "bind") == 0) { /* new listen addresses */
struct listener *l;
int cur_arg;
}
goto out;
}
- else if (!strcmp(args[0], "monitor-net")) { /* set the range of IPs to ignore */
+ else if (strcmp(args[0], "monitor-net") == 0) { /* set the range of IPs to ignore */
ha_alert("parsing [%s:%d] : 'monitor-net' doesn't exist anymore. Please use 'http-request return status 200 if { src %s }' instead.\n", file, linenum, args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "monitor-uri")) { /* set the URI to intercept */
+ else if (strcmp(args[0], "monitor-uri") == 0) { /* set the URI to intercept */
if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
goto out;
}
- else if (!strcmp(args[0], "mode")) { /* sets the proxy mode */
+ else if (strcmp(args[0], "mode") == 0) { /* sets the proxy mode */
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
- if (!strcmp(args[1], "http")) curproxy->mode = PR_MODE_HTTP;
- else if (!strcmp(args[1], "tcp")) curproxy->mode = PR_MODE_TCP;
- else if (!strcmp(args[1], "health")) {
+ if (strcmp(args[1], "http") == 0) curproxy->mode = PR_MODE_HTTP;
+ else if (strcmp(args[1], "tcp") == 0) curproxy->mode = PR_MODE_TCP;
+ else if (strcmp(args[1], "health") == 0) {
ha_alert("parsing [%s:%d] : 'mode health' doesn't exist anymore. Please use 'http-request return status 200' instead.\n", file, linenum);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
goto out;
}
}
- else if (!strcmp(args[0], "id")) {
+ else if (strcmp(args[0], "id") == 0) {
struct eb32_node *node;
if (curproxy == &defproxy) {
}
eb32_insert(&used_proxy_id, &curproxy->conf.id);
}
- else if (!strcmp(args[0], "description")) {
+ else if (strcmp(args[0], "description") == 0) {
int i, len=0;
char *d;
d += snprintf(d, curproxy->desc + len - d, " %s", args[i]);
}
- else if (!strcmp(args[0], "disabled")) { /* disables this proxy */
+ else if (strcmp(args[0], "disabled") == 0) { /* disables this proxy */
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
curproxy->disabled = 1;
}
- else if (!strcmp(args[0], "enabled")) { /* enables this proxy (used to revert a disabled default) */
+ else if (strcmp(args[0], "enabled") == 0) { /* enables this proxy (used to revert a disabled default) */
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
curproxy->disabled = 0;
}
- else if (!strcmp(args[0], "bind-process")) { /* enable this proxy only on some processes */
+ else if (strcmp(args[0], "bind-process") == 0) { /* enable this proxy only on some processes */
int cur_arg = 1;
unsigned long set = 0;
}
curproxy->bind_proc = set;
}
- else if (!strcmp(args[0], "acl")) { /* add an ACL */
+ else if (strcmp(args[0], "acl") == 0) { /* add an ACL */
if (curproxy == &defproxy) {
ha_alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
}
- else if (!strcmp(args[0], "dynamic-cookie-key")) { /* Dynamic cookies secret key */
+ else if (strcmp(args[0], "dynamic-cookie-key") == 0) { /* Dynamic cookies secret key */
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
free(curproxy->dyncookie_key);
curproxy->dyncookie_key = strdup(args[1]);
}
- else if (!strcmp(args[0], "cookie")) { /* cookie name */
+ else if (strcmp(args[0], "cookie") == 0) { /* cookie name */
int cur_arg;
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
cur_arg = 2;
while (*(args[cur_arg])) {
- if (!strcmp(args[cur_arg], "rewrite")) {
+ if (strcmp(args[cur_arg], "rewrite") == 0) {
curproxy->ck_opts |= PR_CK_RW;
}
- else if (!strcmp(args[cur_arg], "indirect")) {
+ else if (strcmp(args[cur_arg], "indirect") == 0) {
curproxy->ck_opts |= PR_CK_IND;
}
- else if (!strcmp(args[cur_arg], "insert")) {
+ else if (strcmp(args[cur_arg], "insert") == 0) {
curproxy->ck_opts |= PR_CK_INS;
}
- else if (!strcmp(args[cur_arg], "nocache")) {
+ else if (strcmp(args[cur_arg], "nocache") == 0) {
curproxy->ck_opts |= PR_CK_NOC;
}
- else if (!strcmp(args[cur_arg], "postonly")) {
+ else if (strcmp(args[cur_arg], "postonly") == 0) {
curproxy->ck_opts |= PR_CK_POST;
}
- else if (!strcmp(args[cur_arg], "preserve")) {
+ else if (strcmp(args[cur_arg], "preserve") == 0) {
curproxy->ck_opts |= PR_CK_PSV;
}
- else if (!strcmp(args[cur_arg], "prefix")) {
+ else if (strcmp(args[cur_arg], "prefix") == 0) {
curproxy->ck_opts |= PR_CK_PFX;
}
- else if (!strcmp(args[cur_arg], "httponly")) {
+ else if (strcmp(args[cur_arg], "httponly") == 0) {
curproxy->ck_opts |= PR_CK_HTTPONLY;
}
- else if (!strcmp(args[cur_arg], "secure")) {
+ else if (strcmp(args[cur_arg], "secure") == 0) {
curproxy->ck_opts |= PR_CK_SECURE;
}
- else if (!strcmp(args[cur_arg], "domain")) {
+ else if (strcmp(args[cur_arg], "domain") == 0) {
if (!*args[cur_arg + 1]) {
ha_alert("parsing [%s:%d]: '%s' expects <domain> as argument.\n",
file, linenum, args[cur_arg]);
}
cur_arg++;
}
- else if (!strcmp(args[cur_arg], "maxidle")) {
+ else if (strcmp(args[cur_arg], "maxidle") == 0) {
unsigned int maxidle;
const char *res;
curproxy->cookie_maxidle = maxidle;
cur_arg++;
}
- else if (!strcmp(args[cur_arg], "maxlife")) {
+ else if (strcmp(args[cur_arg], "maxlife") == 0) {
unsigned int maxlife;
const char *res;
curproxy->cookie_maxlife = maxlife;
cur_arg++;
}
- else if (!strcmp(args[cur_arg], "dynamic")) { /* Dynamic persistent cookies secret key */
+ else if (strcmp(args[cur_arg], "dynamic") == 0) { /* Dynamic persistent cookies secret key */
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[cur_arg], NULL))
err_code |= ERR_WARN;
curproxy->ck_opts |= PR_CK_DYNAMIC;
}
- else if (!strcmp(args[cur_arg], "attr")) {
+ else if (strcmp(args[cur_arg], "attr") == 0) {
char *val;
if (!*args[cur_arg + 1]) {
ha_alert("parsing [%s:%d]: '%s' expects <value> as argument.\n",
err_code |= ERR_ALERT | ERR_FATAL;
}
}/* end else if (!strcmp(args[0], "cookie")) */
- else if (!strcmp(args[0], "email-alert")) {
+ else if (strcmp(args[0], "email-alert") == 0) {
if (*(args[1]) == 0) {
ha_alert("parsing [%s:%d] : missing argument after '%s'.\n",
file, linenum, args[0]);
goto out;
}
- if (!strcmp(args[1], "from")) {
+ if (strcmp(args[1], "from") == 0) {
if (*(args[1]) == 0) {
ha_alert("parsing [%s:%d] : missing argument after '%s'.\n",
file, linenum, args[1]);
free(curproxy->email_alert.from);
curproxy->email_alert.from = strdup(args[2]);
}
- else if (!strcmp(args[1], "mailers")) {
+ else if (strcmp(args[1], "mailers") == 0) {
if (*(args[1]) == 0) {
ha_alert("parsing [%s:%d] : missing argument after '%s'.\n",
file, linenum, args[1]);
free(curproxy->email_alert.mailers.name);
curproxy->email_alert.mailers.name = strdup(args[2]);
}
- else if (!strcmp(args[1], "myhostname")) {
+ else if (strcmp(args[1], "myhostname") == 0) {
if (*(args[1]) == 0) {
ha_alert("parsing [%s:%d] : missing argument after '%s'.\n",
file, linenum, args[1]);
free(curproxy->email_alert.myhostname);
curproxy->email_alert.myhostname = strdup(args[2]);
}
- else if (!strcmp(args[1], "level")) {
+ else if (strcmp(args[1], "level") == 0) {
curproxy->email_alert.level = get_log_level(args[2]);
if (curproxy->email_alert.level < 0) {
ha_alert("parsing [%s:%d] : unknown log level '%s' after '%s'\n",
goto out;
}
}
- else if (!strcmp(args[1], "to")) {
+ else if (strcmp(args[1], "to") == 0) {
if (*(args[1]) == 0) {
ha_alert("parsing [%s:%d] : missing argument after '%s'.\n",
file, linenum, args[1]);
/* Indicate that the email_alert is at least partially configured */
curproxy->email_alert.set = 1;
}/* end else if (!strcmp(args[0], "email-alert")) */
- else if (!strcmp(args[0], "persist")) { /* persist */
+ else if (strcmp(args[0], "persist") == 0) { /* persist */
if (*(args[1]) == 0) {
ha_alert("parsing [%s:%d] : missing persist method.\n",
file, linenum);
goto out;
}
}
- else if (!strcmp(args[0], "appsession")) { /* cookie name */
+ else if (strcmp(args[0], "appsession") == 0) { /* cookie name */
ha_alert("parsing [%s:%d] : '%s' is not supported anymore since HAProxy 1.6.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "load-server-state-from-file")) {
+ else if (strcmp(args[0], "load-server-state-from-file") == 0) {
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
- if (!strcmp(args[1], "global")) { /* use the file pointed to by global server-state-file directive */
+ if (strcmp(args[1], "global") == 0) { /* use the file pointed to by global server-state-file directive */
curproxy->load_server_state_from_file = PR_SRV_STATE_FILE_GLOBAL;
}
- else if (!strcmp(args[1], "local")) { /* use the server-state-file-name variable to locate the server-state file */
+ else if (strcmp(args[1], "local") == 0) { /* use the server-state-file-name variable to locate the server-state file */
curproxy->load_server_state_from_file = PR_SRV_STATE_FILE_LOCAL;
}
- else if (!strcmp(args[1], "none")) { /* don't use server-state-file directive for this backend */
+ else if (strcmp(args[1], "none") == 0) { /* don't use server-state-file directive for this backend */
curproxy->load_server_state_from_file = PR_SRV_STATE_FILE_NONE;
}
else {
goto out;
}
}
- else if (!strcmp(args[0], "server-state-file-name")) {
+ else if (strcmp(args[0], "server-state-file-name") == 0) {
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
if (*(args[1]) == 0) {
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[1], "use-backend-name"))
+ else if (strcmp(args[1], "use-backend-name") == 0)
curproxy->server_state_file_name = strdup(curproxy->id);
else
curproxy->server_state_file_name = strdup(args[1]);
}
- else if (!strcmp(args[0], "max-session-srv-conns")) {
+ else if (strcmp(args[0], "max-session-srv-conns") == 0) {
if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
if (*(args[1]) == 0) {
}
curproxy->max_out_conns = atoi(args[1]);
}
- else if (!strcmp(args[0], "capture")) {
+ else if (strcmp(args[0], "capture") == 0) {
if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
- if (!strcmp(args[1], "cookie")) { /* name of a cookie to capture */
+ if (strcmp(args[1], "cookie") == 0) { /* name of a cookie to capture */
if (curproxy == &defproxy) {
ha_alert("parsing [%s:%d] : '%s %s' not allowed in 'defaults' section.\n", file, linenum, args[0], args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
curproxy->capture_len = atol(args[4]);
curproxy->to_log |= LW_COOKIE;
}
- else if (!strcmp(args[1], "request") && !strcmp(args[2], "header")) {
+ else if (strcmp(args[1], "request") == 0 && strcmp(args[2], "header") == 0) {
struct cap_hdr *hdr;
if (curproxy == &defproxy) {
curproxy->req_cap = hdr;
curproxy->to_log |= LW_REQHDR;
}
- else if (!strcmp(args[1], "response") && !strcmp(args[2], "header")) {
+ else if (strcmp(args[1], "response") == 0 && strcmp(args[2], "header") == 0) {
struct cap_hdr *hdr;
if (curproxy == &defproxy) {
goto out;
}
}
- else if (!strcmp(args[0], "retries")) { /* connection retries */
+ else if (strcmp(args[0], "retries") == 0) { /* connection retries */
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
}
curproxy->conn_retries = atol(args[1]);
}
- else if (!strcmp(args[0], "http-request")) { /* request access control: allow/deny/auth */
+ else if (strcmp(args[0], "http-request") == 0) { /* request access control: allow/deny/auth */
struct act_rule *rule;
if (curproxy == &defproxy) {
LIST_ADDQ(&curproxy->http_req_rules, &rule->list);
}
- else if (!strcmp(args[0], "http-response")) { /* response access control */
+ else if (strcmp(args[0], "http-response") == 0) { /* response access control */
struct act_rule *rule;
if (curproxy == &defproxy) {
LIST_ADDQ(&curproxy->http_res_rules, &rule->list);
}
- else if (!strcmp(args[0], "http-after-response")) {
+ else if (strcmp(args[0], "http-after-response") == 0) {
struct act_rule *rule;
if (curproxy == &defproxy) {
LIST_ADDQ(&curproxy->http_after_res_rules, &rule->list);
}
- else if (!strcmp(args[0], "http-send-name-header")) { /* send server name in request header */
+ else if (strcmp(args[0], "http-send-name-header") == 0) { /* send server name in request header */
/* set the header name and length into the proxy structure */
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
curproxy->server_id_hdr_len = strlen(curproxy->server_id_hdr_name);
ist2bin_lc(curproxy->server_id_hdr_name, ist2(curproxy->server_id_hdr_name, curproxy->server_id_hdr_len));
}
- else if (!strcmp(args[0], "block")) {
+ else if (strcmp(args[0], "block") == 0) {
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. Use 'http-request deny' which uses the exact same syntax.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "redirect")) {
+ else if (strcmp(args[0], "redirect") == 0) {
struct redirect_rule *rule;
if (curproxy == &defproxy) {
(curproxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR,
file, linenum);
}
- else if (!strcmp(args[0], "use_backend")) {
+ else if (strcmp(args[0], "use_backend") == 0) {
struct switching_rule *rule;
if (curproxy == &defproxy) {
LIST_ADDQ(&curproxy->server_rules, &rule->list);
curproxy->be_req_ana |= AN_REQ_SRV_RULES;
}
- else if ((!strcmp(args[0], "force-persist")) ||
- (!strcmp(args[0], "ignore-persist"))) {
+ else if ((strcmp(args[0], "force-persist") == 0) ||
+ (strcmp(args[0], "ignore-persist") == 0)) {
struct persist_rule *rule;
if (curproxy == &defproxy) {
rule = calloc(1, sizeof(*rule));
rule->cond = cond;
- if (!strcmp(args[0], "force-persist")) {
+ if (strcmp(args[0], "force-persist") == 0) {
rule->type = PERSIST_TYPE_FORCE;
} else {
rule->type = PERSIST_TYPE_IGNORE;
LIST_INIT(&rule->list);
LIST_ADDQ(&curproxy->persist_rules, &rule->list);
}
- else if (!strcmp(args[0], "stick-table")) {
+ else if (strcmp(args[0], "stick-table") == 0) {
struct stktable *other;
if (curproxy == &defproxy) {
curproxy->table->proxies_list = curproxy;
}
}
- else if (!strcmp(args[0], "stick")) {
+ else if (strcmp(args[0], "stick") == 0) {
struct sticking_rule *rule;
struct sample_expr *expr;
int myidx = 0;
else
LIST_ADDQ(&curproxy->sticking_rules, &rule->list);
}
- else if (!strcmp(args[0], "stats")) {
+ else if (strcmp(args[0], "stats") == 0) {
if (curproxy != &defproxy && curproxy->uri_auth == defproxy.uri_auth)
curproxy->uri_auth = NULL; /* we must detach from the default config */
if (!*args[1]) {
goto stats_error_parsing;
- } else if (!strcmp(args[1], "admin")) {
+ } else if (strcmp(args[1], "admin") == 0) {
struct stats_admin_rule *rule;
if (curproxy == &defproxy) {
rule->cond = cond;
LIST_INIT(&rule->list);
LIST_ADDQ(&curproxy->uri_auth->admin_rules, &rule->list);
- } else if (!strcmp(args[1], "uri")) {
+ } else if (strcmp(args[1], "uri") == 0) {
if (*(args[2]) == 0) {
ha_alert("parsing [%s:%d] : 'uri' needs an URI prefix.\n", file, linenum);
err_code |= ERR_ALERT | ERR_FATAL;
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "realm")) {
+ } else if (strcmp(args[1], "realm") == 0) {
if (*(args[2]) == 0) {
ha_alert("parsing [%s:%d] : 'realm' needs an realm name.\n", file, linenum);
err_code |= ERR_ALERT | ERR_FATAL;
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "refresh")) {
+ } else if (strcmp(args[1], "refresh") == 0) {
unsigned interval;
err = parse_time_err(args[2], &interval, TIME_UNIT_S);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "http-request")) { /* request access control: allow/deny/auth */
+ } else if (strcmp(args[1], "http-request") == 0) { /* request access control: allow/deny/auth */
struct act_rule *rule;
if (curproxy == &defproxy) {
file, linenum);
LIST_ADDQ(&curproxy->uri_auth->http_req_rules, &rule->list);
- } else if (!strcmp(args[1], "auth")) {
+ } else if (strcmp(args[1], "auth") == 0) {
if (*(args[2]) == 0) {
ha_alert("parsing [%s:%d] : 'auth' needs a user:password account.\n", file, linenum);
err_code |= ERR_ALERT | ERR_FATAL;
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "scope")) {
+ } else if (strcmp(args[1], "scope") == 0) {
if (*(args[2]) == 0) {
ha_alert("parsing [%s:%d] : 'scope' needs a proxy name.\n", file, linenum);
err_code |= ERR_ALERT | ERR_FATAL;
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "enable")) {
+ } else if (strcmp(args[1], "enable") == 0) {
if (!stats_check_init_uri_auth(&curproxy->uri_auth)) {
ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "hide-version")) {
+ } else if (strcmp(args[1], "hide-version") == 0) {
if (!stats_set_flag(&curproxy->uri_auth, STAT_HIDEVER)) {
ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "show-legends")) {
+ } else if (strcmp(args[1], "show-legends") == 0) {
if (!stats_set_flag(&curproxy->uri_auth, STAT_SHLGNDS)) {
ha_alert("parsing [%s:%d]: out of memory.\n", file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "show-modules")) {
+ } else if (strcmp(args[1], "show-modules") == 0) {
if (!stats_set_flag(&curproxy->uri_auth, STAT_SHMODULES)) {
ha_alert("parsing [%s:%d]: out of memory.\n", file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "show-node")) {
+ } else if (strcmp(args[1], "show-node") == 0) {
if (*args[2]) {
int i;
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
- } else if (!strcmp(args[1], "show-desc")) {
+ } else if (strcmp(args[1], "show-desc") == 0) {
char *desc = NULL;
if (*args[2]) {
goto out;
}
}
- else if (!strcmp(args[0], "option")) {
+ else if (strcmp(args[0], "option") == 0) {
int optnum;
if (*(args[1]) == '\0') {
}
for (optnum = 0; cfg_opts[optnum].name; optnum++) {
- if (!strcmp(args[1], cfg_opts[optnum].name)) {
+ if (strcmp(args[1], cfg_opts[optnum].name) == 0) {
if (cfg_opts[optnum].cap == PR_CAP_NONE) {
ha_alert("parsing [%s:%d]: option '%s' is not supported due to build options.\n",
file, linenum, cfg_opts[optnum].name);
}
for (optnum = 0; cfg_opts2[optnum].name; optnum++) {
- if (!strcmp(args[1], cfg_opts2[optnum].name)) {
+ if (strcmp(args[1], cfg_opts2[optnum].name) == 0) {
if (cfg_opts2[optnum].cap == PR_CAP_NONE) {
ha_alert("parsing [%s:%d]: option '%s' is not supported due to build options.\n",
file, linenum, cfg_opts2[optnum].name);
}
/* "[no] option http-use-htx" is deprecated */
- if (!strcmp(cfg_opts2[optnum].name, "http-use-htx")) {
+ if (strcmp(cfg_opts2[optnum].name, "http-use-htx") == 0) {
if (kwm ==KWM_NO) {
ha_warning("parsing [%s:%d]: option '%s' is deprecated and ignored."
" The HTX mode is now the only supported mode.\n",
goto out;
}
- if (!strcmp(args[1], "httplog")) {
+ if (strcmp(args[1], "httplog") == 0) {
char *logformat;
/* generate a complete HTTP log */
logformat = default_http_log_format;
if (*(args[2]) != '\0') {
- if (!strcmp(args[2], "clf")) {
+ if (strcmp(args[2], "clf") == 0) {
curproxy->options2 |= PR_O2_CLFLOG;
logformat = clf_http_log_format;
} else {
err_code |= ERR_WARN;
}
}
- else if (!strcmp(args[1], "tcplog")) {
+ else if (strcmp(args[1], "tcplog") == 0) {
if (curproxy->conf.logformat_string && curproxy == &defproxy) {
char *oldlogformat = "log-format";
err_code |= ERR_WARN;
}
}
- else if (!strcmp(args[1], "tcpka")) {
+ else if (strcmp(args[1], "tcpka") == 0) {
/* enable TCP keep-alives on client and server streams */
if (warnifnotcap(curproxy, PR_CAP_BE | PR_CAP_FE, file, linenum, args[1], NULL))
err_code |= ERR_WARN;
if (curproxy->cap & PR_CAP_BE)
curproxy->options |= PR_O_TCP_SRV_KA;
}
- else if (!strcmp(args[1], "httpchk")) {
+ else if (strcmp(args[1], "httpchk") == 0) {
err_code |= proxy_parse_httpchk_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "ssl-hello-chk")) {
+ else if (strcmp(args[1], "ssl-hello-chk") == 0) {
err_code |= proxy_parse_ssl_hello_chk_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "smtpchk")) {
+ else if (strcmp(args[1], "smtpchk") == 0) {
err_code |= proxy_parse_smtpchk_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "pgsql-check")) {
+ else if (strcmp(args[1], "pgsql-check") == 0) {
err_code |= proxy_parse_pgsql_check_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "redis-check")) {
+ else if (strcmp(args[1], "redis-check") == 0) {
err_code |= proxy_parse_redis_check_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "mysql-check")) {
+ else if (strcmp(args[1], "mysql-check") == 0) {
err_code |= proxy_parse_mysql_check_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "ldap-check")) {
+ else if (strcmp(args[1], "ldap-check") == 0) {
err_code |= proxy_parse_ldap_check_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "spop-check")) {
+ else if (strcmp(args[1], "spop-check") == 0) {
err_code |= proxy_parse_spop_check_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "tcp-check")) {
+ else if (strcmp(args[1], "tcp-check") == 0) {
err_code |= proxy_parse_tcp_check_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "external-check")) {
+ else if (strcmp(args[1], "external-check") == 0) {
err_code |= proxy_parse_external_check_opt(args, 0, curproxy, &defproxy, file, linenum);
if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[1], "forwardfor")) {
+ else if (strcmp(args[1], "forwardfor") == 0) {
int cur_arg;
/* insert x-forwarded-for field, but not for the IP address listed as an except.
/* loop to go through arguments - start at 2, since 0+1 = "option" "forwardfor" */
cur_arg = 2;
while (*(args[cur_arg])) {
- if (!strcmp(args[cur_arg], "except")) {
+ if (strcmp(args[cur_arg], "except") == 0) {
/* suboption except - needs additional argument for it */
if (!*(args[cur_arg+1]) || !str2net(args[cur_arg+1], 1, &curproxy->except_net, &curproxy->except_mask)) {
ha_alert("parsing [%s:%d] : '%s %s %s' expects <address>[/mask] as argument.\n",
/* flush useless bits */
curproxy->except_net.s_addr &= curproxy->except_mask.s_addr;
cur_arg += 2;
- } else if (!strcmp(args[cur_arg], "header")) {
+ } else if (strcmp(args[cur_arg], "header") == 0) {
/* suboption header - needs additional argument for it */
if (*(args[cur_arg+1]) == 0) {
ha_alert("parsing [%s:%d] : '%s %s %s' expects <header_name> as argument.\n",
curproxy->fwdfor_hdr_name = strdup(args[cur_arg+1]);
curproxy->fwdfor_hdr_len = strlen(curproxy->fwdfor_hdr_name);
cur_arg += 2;
- } else if (!strcmp(args[cur_arg], "if-none")) {
+ } else if (strcmp(args[cur_arg], "if-none") == 0) {
curproxy->options &= ~PR_O_FF_ALWAYS;
cur_arg += 1;
} else {
}
} /* end while loop */
}
- else if (!strcmp(args[1], "originalto")) {
+ else if (strcmp(args[1], "originalto") == 0) {
int cur_arg;
/* insert x-original-to field, but not for the IP address listed as an except.
/* loop to go through arguments - start at 2, since 0+1 = "option" "originalto" */
cur_arg = 2;
while (*(args[cur_arg])) {
- if (!strcmp(args[cur_arg], "except")) {
+ if (strcmp(args[cur_arg], "except") == 0) {
/* suboption except - needs additional argument for it */
if (!*(args[cur_arg+1]) || !str2net(args[cur_arg+1], 1, &curproxy->except_to, &curproxy->except_mask_to)) {
ha_alert("parsing [%s:%d] : '%s %s %s' expects <address>[/mask] as argument.\n",
/* flush useless bits */
curproxy->except_to.s_addr &= curproxy->except_mask_to.s_addr;
cur_arg += 2;
- } else if (!strcmp(args[cur_arg], "header")) {
+ } else if (strcmp(args[cur_arg], "header") == 0) {
/* suboption header - needs additional argument for it */
if (*(args[cur_arg+1]) == 0) {
ha_alert("parsing [%s:%d] : '%s %s %s' expects <header_name> as argument.\n",
}
goto out;
}
- else if (!strcmp(args[0], "default_backend")) {
+ else if (strcmp(args[0], "default_backend") == 0) {
if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
if (alertif_too_many_args_idx(1, 0, file, linenum, args, &err_code))
goto out;
}
- else if (!strcmp(args[0], "redispatch") || !strcmp(args[0], "redisp")) {
+ else if (strcmp(args[0], "redispatch") == 0 || strcmp(args[0], "redisp") == 0) {
ha_alert("parsing [%s:%d] : keyword '%s' directive is not supported anymore since HAProxy 2.1. Use 'option redispatch'.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "http-reuse")) {
+ else if (strcmp(args[0], "http-reuse") == 0) {
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
goto out;
}
}
- else if (!strcmp(args[0], "monitor")) {
+ else if (strcmp(args[0], "monitor") == 0) {
if (curproxy == &defproxy) {
ha_alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
}
}
#ifdef USE_TPROXY
- else if (!strcmp(args[0], "transparent")) {
+ else if (strcmp(args[0], "transparent") == 0) {
/* enable transparent proxy connections */
curproxy->options |= PR_O_TRANSP;
if (alertif_too_many_args(0, file, linenum, args, &err_code))
goto out;
}
#endif
- else if (!strcmp(args[0], "maxconn")) { /* maxconn */
+ else if (strcmp(args[0], "maxconn") == 0) { /* maxconn */
if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], " Maybe you want 'fullconn' instead ?"))
err_code |= ERR_WARN;
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
}
- else if (!strcmp(args[0], "backlog")) { /* backlog */
+ else if (strcmp(args[0], "backlog") == 0) { /* backlog */
if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
}
- else if (!strcmp(args[0], "fullconn")) { /* fullconn */
+ else if (strcmp(args[0], "fullconn") == 0) { /* fullconn */
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], " Maybe you want 'maxconn' instead ?"))
err_code |= ERR_WARN;
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
}
- else if (!strcmp(args[0], "grace")) { /* grace time (ms) */
+ else if (strcmp(args[0], "grace") == 0) { /* grace time (ms) */
if (*(args[1]) == 0) {
ha_alert("parsing [%s:%d] : '%s' expects a time in milliseconds.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
ha_warning("parsing [%s:%d]: the '%s' is deprecated and will be removed in a future version.\n",
file, linenum, args[0]);
}
- else if (!strcmp(args[0], "dispatch")) { /* dispatch address */
+ else if (strcmp(args[0], "dispatch") == 0) { /* dispatch address */
struct sockaddr_storage *sk;
int port1, port2;
curproxy->dispatch_addr = *sk;
curproxy->options |= PR_O_DISPATCH;
}
- else if (!strcmp(args[0], "balance")) { /* set balancing with optional algorithm */
+ else if (strcmp(args[0], "balance") == 0) { /* set balancing with optional algorithm */
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
goto out;
}
}
- else if (!strcmp(args[0], "hash-type")) { /* set hashing method */
+ else if (strcmp(args[0], "hash-type") == 0) { /* set hashing method */
/**
* The syntax for hash-type config element is
* hash-type {map-based|consistent} [[<algo>] avalanche]
curproxy->lbprm.algo |= BE_LB_HMOD_AVAL;
} else {
/* set the hash function */
- if (!strcmp(args[2], "sdbm")) {
+ if (strcmp(args[2], "sdbm") == 0) {
curproxy->lbprm.algo |= BE_LB_HFCN_SDBM;
}
- else if (!strcmp(args[2], "djb2")) {
+ else if (strcmp(args[2], "djb2") == 0) {
curproxy->lbprm.algo |= BE_LB_HFCN_DJB2;
}
- else if (!strcmp(args[2], "wt6")) {
+ else if (strcmp(args[2], "wt6") == 0) {
curproxy->lbprm.algo |= BE_LB_HFCN_WT6;
}
- else if (!strcmp(args[2], "crc32")) {
+ else if (strcmp(args[2], "crc32") == 0) {
curproxy->lbprm.algo |= BE_LB_HFCN_CRC32;
}
else {
}
/* set the hash modifier */
- if (!strcmp(args[3], "avalanche")) {
+ if (strcmp(args[3], "avalanche") == 0) {
curproxy->lbprm.algo |= BE_LB_HMOD_AVAL;
}
else if (*args[3]) {
err_code |= ERR_WARN;
}
}
- else if (!strcmp(args[0], "log-format-sd")) {
+ else if (strcmp(args[0], "log-format-sd") == 0) {
if (!*(args[1])) {
ha_alert("parsing [%s:%d] : %s expects an argument.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
err_code |= ERR_WARN;
}
}
- else if (!strcmp(args[0], "log-tag")) { /* tag to report to syslog */
+ else if (strcmp(args[0], "log-tag") == 0) { /* tag to report to syslog */
if (*(args[1]) == 0) {
ha_alert("parsing [%s:%d] : '%s' expects a tag for use in syslog.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
}
- else if (!strcmp(args[0], "log")) { /* "no log" or "log ..." */
+ else if (strcmp(args[0], "log") == 0) { /* "no log" or "log ..." */
if (!parse_logsrv(args, &curproxy->logsrvs, (kwm == KWM_NO), &errmsg)) {
ha_alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
}
- else if (!strcmp(args[0], "source")) { /* address to which we bind when connecting */
+ else if (strcmp(args[0], "source") == 0) { /* address to which we bind when connecting */
int cur_arg;
int port1, port2;
struct sockaddr_storage *sk;
cur_arg = 2;
while (*(args[cur_arg])) {
- if (!strcmp(args[cur_arg], "usesrc")) { /* address to use outside */
+ if (strcmp(args[cur_arg], "usesrc") == 0) { /* address to use outside */
#if defined(CONFIG_HAP_TRANSPARENT)
if (!*args[cur_arg + 1]) {
ha_alert("parsing [%s:%d] : '%s' expects <addr>[:<port>], 'client', or 'clientip' as argument.\n",
goto out;
}
- if (!strcmp(args[cur_arg + 1], "client")) {
+ if (strcmp(args[cur_arg + 1], "client") == 0) {
curproxy->conn_src.opts &= ~CO_SRC_TPROXY_MASK;
curproxy->conn_src.opts |= CO_SRC_TPROXY_CLI;
- } else if (!strcmp(args[cur_arg + 1], "clientip")) {
+ } else if (strcmp(args[cur_arg + 1], "clientip") == 0) {
curproxy->conn_src.opts &= ~CO_SRC_TPROXY_MASK;
curproxy->conn_src.opts |= CO_SRC_TPROXY_CIP;
} else if (!strncmp(args[cur_arg + 1], "hdr_ip(", 7)) {
continue;
}
- if (!strcmp(args[cur_arg], "interface")) { /* specifically bind to this interface */
+ if (strcmp(args[cur_arg], "interface") == 0) { /* specifically bind to this interface */
#ifdef SO_BINDTODEVICE
if (!*args[cur_arg + 1]) {
ha_alert("parsing [%s:%d] : '%s' : missing interface name.\n",
goto out;
}
}
- else if (!strcmp(args[0], "usesrc")) { /* address to use outside: needs "source" first */
+ else if (strcmp(args[0], "usesrc") == 0) { /* address to use outside: needs "source" first */
ha_alert("parsing [%s:%d] : '%s' only allowed after a '%s' statement.\n",
file, linenum, "usesrc", "source");
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "cliexp") || !strcmp(args[0], "reqrep")) { /* replace request header from a regex */
+ else if (strcmp(args[0], "cliexp") == 0 || strcmp(args[0], "reqrep") == 0) { /* replace request header from a regex */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request replace-path', 'http-request replace-uri' or 'http-request replace-header' instead.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqdel")) { /* delete request header from a regex */
+ else if (strcmp(args[0], "reqdel") == 0) { /* delete request header from a regex */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request del-header' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqdeny")) { /* deny a request if a header matches this regex */
+ else if (strcmp(args[0], "reqdeny") == 0) { /* deny a request if a header matches this regex */
ha_alert("parsing [%s:%d] : The '%s' not supported anymore since HAProxy 2.1. "
"Use 'http-request deny' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqpass")) { /* pass this header without allowing or denying the request */
+ else if (strcmp(args[0], "reqpass") == 0) { /* pass this header without allowing or denying the request */
ha_alert("parsing [%s:%d] : The '%s' not supported anymore since HAProxy 2.1.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqallow")) { /* allow a request if a header matches this regex */
+ else if (strcmp(args[0], "reqallow") == 0) { /* allow a request if a header matches this regex */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request allow' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqtarpit")) { /* tarpit a request if a header matches this regex */
+ else if (strcmp(args[0], "reqtarpit") == 0) { /* tarpit a request if a header matches this regex */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request tarpit' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqirep")) { /* replace request header from a regex, ignoring case */
+ else if (strcmp(args[0], "reqirep") == 0) { /* replace request header from a regex, ignoring case */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request replace-header' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqidel")) { /* delete request header from a regex ignoring case */
+ else if (strcmp(args[0], "reqidel") == 0) { /* delete request header from a regex ignoring case */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request del-header' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqideny")) { /* deny a request if a header matches this regex ignoring case */
+ else if (strcmp(args[0], "reqideny") == 0) { /* deny a request if a header matches this regex ignoring case */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request deny' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqipass")) { /* pass this header without allowing or denying the request */
+ else if (strcmp(args[0], "reqipass") == 0) { /* pass this header without allowing or denying the request */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqiallow")) { /* allow a request if a header matches this regex ignoring case */
+ else if (strcmp(args[0], "reqiallow") == 0) { /* allow a request if a header matches this regex ignoring case */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request allow' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqitarpit")) { /* tarpit a request if a header matches this regex ignoring case */
+ else if (strcmp(args[0], "reqitarpit") == 0) { /* tarpit a request if a header matches this regex ignoring case */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request tarpit' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "reqadd")) { /* add request header */
+ else if (strcmp(args[0], "reqadd") == 0) { /* add request header */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-request add-header' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "srvexp") || !strcmp(args[0], "rsprep")) { /* replace response header from a regex */
+ else if (strcmp(args[0], "srvexp") == 0 || strcmp(args[0], "rsprep") == 0) { /* replace response header from a regex */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-response replace-header' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "rspdel")) { /* delete response header from a regex */
+ else if (strcmp(args[0], "rspdel") == 0) { /* delete response header from a regex */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-response del-header' .\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "rspdeny")) { /* block response header from a regex */
+ else if (strcmp(args[0], "rspdeny") == 0) { /* block response header from a regex */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-response deny' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "rspirep")) { /* replace response header from a regex ignoring case */
+ else if (strcmp(args[0], "rspirep") == 0) { /* replace response header from a regex ignoring case */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-response replace-header' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "rspidel")) { /* delete response header from a regex ignoring case */
+ else if (strcmp(args[0], "rspidel") == 0) { /* delete response header from a regex ignoring case */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-response del-header' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "rspideny")) { /* block response header from a regex ignoring case */
+ else if (strcmp(args[0], "rspideny") == 0) { /* block response header from a regex ignoring case */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-response deny' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- else if (!strcmp(args[0], "rspadd")) { /* add response header */
+ else if (strcmp(args[0], "rspadd") == 0) { /* add response header */
ha_alert("parsing [%s:%d] : The '%s' directive is not supported anymore since HAProxy 2.1. "
"Use 'http-response add-header' instead.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
for (i = 1; *args[i]; i++) {
- if (!strcmp("bundle", args[i])) {
+ if (strcmp("bundle", args[i]) == 0) {
gf |= SSL_GF_BUNDLE;
- } else if (!strcmp("sctl", args[i])) {
+ } else if (strcmp("sctl", args[i]) == 0) {
gf |= SSL_GF_SCTL;
- } else if (!strcmp("ocsp", args[i])){
+ } else if (strcmp("ocsp", args[i]) == 0){
gf |= SSL_GF_OCSP;
- } else if (!strcmp("issuer", args[i])){
+ } else if (strcmp("issuer", args[i]) == 0){
gf |= SSL_GF_OCSP_ISSUER;
- } else if (!strcmp("key", args[i])) {
+ } else if (strcmp("key", args[i]) == 0) {
gf |= SSL_GF_KEY;
- } else if (!strcmp("none", args[i])) {
+ } else if (strcmp("none", args[i]) == 0) {
if (gf != SSL_GF_NONE)
goto err_alone;
gf = SSL_GF_NONE;
i++;
break;
- } else if (!strcmp("all", args[i])) {
+ } else if (strcmp("all", args[i]) == 0) {
if (gf != SSL_GF_NONE)
goto err_alone;
gf = SSL_GF_ALL;
if (!p)
goto fail;
p++;
- if (!strcmp(p, "sslv3"))
+ if (strcmp(p, "sslv3") == 0)
v = CONF_SSLV3;
- else if (!strcmp(p, "tlsv10"))
+ else if (strcmp(p, "tlsv10") == 0)
v = CONF_TLSV10;
- else if (!strcmp(p, "tlsv11"))
+ else if (strcmp(p, "tlsv11") == 0)
v = CONF_TLSV11;
- else if (!strcmp(p, "tlsv12"))
+ else if (strcmp(p, "tlsv12") == 0)
v = CONF_TLSV12;
- else if (!strcmp(p, "tlsv13"))
+ else if (strcmp(p, "tlsv13") == 0)
v = CONF_TLSV13;
else
goto fail;
return ERR_ALERT | ERR_FATAL;
}
for (i = CONF_TLSV_MIN; i <= CONF_TLSV_MAX; i++)
- if (!strcmp(argv, methodVersions[i].name))
+ if (strcmp(argv, methodVersions[i].name) == 0)
v = i;
if (!v) {
memprintf(err, "'%s' : unknown ssl/tls version", args[cur_arg + 1]);
return ERR_ALERT | ERR_FATAL;
}
- if (!strcmp("ssl-min-ver", args[cur_arg]))
+ if (strcmp("ssl-min-ver", args[cur_arg]) == 0)
methods->min = v;
- else if (!strcmp("ssl-max-ver", args[cur_arg]))
+ else if (strcmp("ssl-max-ver", args[cur_arg]) == 0)
methods->max = v;
else {
memprintf(err, "'%s' : option not implemented", args[cur_arg]);
return -1;
}
while (*(args[i])) {
- if (!strcmp(args[i], "no-tls-tickets"))
+ if (strcmp(args[i], "no-tls-tickets") == 0)
global_ssl.listen_default_ssloptions |= BC_SSL_O_NO_TLS_TICKETS;
- else if (!strcmp(args[i], "prefer-client-ciphers"))
+ else if (strcmp(args[i], "prefer-client-ciphers") == 0)
global_ssl.listen_default_ssloptions |= BC_SSL_O_PREF_CLIE_CIPH;
- else if (!strcmp(args[i], "ssl-min-ver") || !strcmp(args[i], "ssl-max-ver")) {
+ else if (strcmp(args[i], "ssl-min-ver") == 0 || strcmp(args[i], "ssl-max-ver") == 0) {
if (!parse_tls_method_minmax(args, i, &global_ssl.listen_default_sslmethods, err))
i++;
else {
return -1;
}
while (*(args[i])) {
- if (!strcmp(args[i], "no-tls-tickets"))
+ if (strcmp(args[i], "no-tls-tickets") == 0)
global_ssl.connect_default_ssloptions |= SRV_SSL_O_NO_TLS_TICKETS;
- else if (!strcmp(args[i], "ssl-min-ver") || !strcmp(args[i], "ssl-max-ver")) {
+ else if (strcmp(args[i], "ssl-min-ver") == 0 || strcmp(args[i], "ssl-max-ver") == 0) {
if (!parse_tls_method_minmax(args, i, &global_ssl.connect_default_sslmethods, err))
i++;
else {
int local_peer, peer;
peer = *args[0] == 'p';
- local_peer = !strcmp(args[1], localpeer);
+ local_peer = strcmp(args[1], localpeer) == 0;
/* The local peer may have already partially been parsed on a "bind" line. */
if (*args[0] == 'p') {
if (bind_line) {
l->options |= LI_O_UNLIMITED; /* don't make the peers subject to global limits */
global.maxsock++; /* for the listening socket */
}
- else if (!strcmp(args[0], "table")) {
+ else if (strcmp(args[0], "table") == 0) {
struct stktable *t, *other;
char *id;
size_t prefix_len;
t->next = stktables_list;
stktables_list = t;
}
- else if (!strcmp(args[0], "disabled")) { /* disables this peers section */
+ else if (strcmp(args[0], "disabled") == 0) { /* disables this peers section */
curpeers->disabled = 1;
}
- else if (!strcmp(args[0], "enabled")) { /* enables this peers section (used to revert a disabled default) */
+ else if (strcmp(args[0], "enabled") == 0) { /* enables this peers section (used to revert a disabled default) */
curpeers->disabled = 0;
}
else if (*args[0] != 0) {
const char *err;
const char *item = args[0];
- if (!strcmp(item, "namespace_list")) {
+ if (strcmp(item, "namespace_list") == 0) {
return 0;
}
- else if (!strcmp(item, "namespace")) {
+ else if (strcmp(item, "namespace") == 0) {
size_t idx = 1;
const char *current;
while (*(current = args[idx++])) {
int err_code = 0;
const char *err;
- if (!strcmp(args[0], "userlist")) { /* new userlist */
+ if (strcmp(args[0], "userlist") == 0) { /* new userlist */
struct userlist *newul;
if (!*args[1]) {
}
for (newul = userlist; newul; newul = newul->next)
- if (!strcmp(newul->name, args[1])) {
+ if (strcmp(newul->name, args[1]) == 0) {
ha_warning("parsing [%s:%d]: ignoring duplicated userlist '%s'.\n",
file, linenum, args[1]);
err_code |= ERR_WARN;
newul->next = userlist;
userlist = newul;
- } else if (!strcmp(args[0], "group")) { /* new group */
+ } else if (strcmp(args[0], "group") == 0) { /* new group */
int cur_arg;
const char *err;
struct auth_groups *ag;
goto out;
for (ag = userlist->groups; ag; ag = ag->next)
- if (!strcmp(ag->name, args[1])) {
+ if (strcmp(ag->name, args[1]) == 0) {
ha_warning("parsing [%s:%d]: ignoring duplicated group '%s' in userlist '%s'.\n",
file, linenum, args[1], userlist->name);
err_code |= ERR_ALERT;
cur_arg = 2;
while (*args[cur_arg]) {
- if (!strcmp(args[cur_arg], "users")) {
+ if (strcmp(args[cur_arg], "users") == 0) {
ag->groupusers = strdup(args[cur_arg + 1]);
cur_arg += 2;
continue;
ag->next = userlist->groups;
userlist->groups = ag;
- } else if (!strcmp(args[0], "user")) { /* new user */
+ } else if (strcmp(args[0], "user") == 0) { /* new user */
struct auth_users *newuser;
int cur_arg;
goto out;
for (newuser = userlist->users; newuser; newuser = newuser->next)
- if (!strcmp(newuser->user, args[1])) {
+ if (strcmp(newuser->user, args[1]) == 0) {
ha_warning("parsing [%s:%d]: ignoring duplicated user '%s' in userlist '%s'.\n",
file, linenum, args[1], userlist->name);
err_code |= ERR_ALERT;
cur_arg = 2;
while (*args[cur_arg]) {
- if (!strcmp(args[cur_arg], "password")) {
+ if (strcmp(args[cur_arg], "password") == 0) {
#ifdef USE_LIBCRYPT
if (!crypt("", args[cur_arg + 1])) {
ha_alert("parsing [%s:%d]: the encrypted password used for user '%s' is not supported by crypt(3).\n",
newuser->pass = strdup(args[cur_arg + 1]);
cur_arg += 2;
continue;
- } else if (!strcmp(args[cur_arg], "insecure-password")) {
+ } else if (strcmp(args[cur_arg], "insecure-password") == 0) {
newuser->pass = strdup(args[cur_arg + 1]);
newuser->flags |= AU_O_INSECURE;
cur_arg += 2;
continue;
- } else if (!strcmp(args[cur_arg], "groups")) {
+ } else if (strcmp(args[cur_arg], "groups") == 0) {
newuser->u.groups_names = strdup(args[cur_arg + 1]);
cur_arg += 2;
continue;
continue;
/* check for keyword modifiers "no" and "default" */
- if (!strcmp(args[0], "no")) {
+ if (strcmp(args[0], "no") == 0) {
char *tmp;
kwm = KWM_NO;
*tmp = '\0'; // fix the next arg to \0
args[arg] = tmp;
}
- else if (!strcmp(args[0], "default")) {
+ else if (strcmp(args[0], "default") == 0) {
kwm = KWM_DEF;
for (arg=0; *args[arg+1]; arg++)
args[arg] = args[arg+1]; // shift args after inversion
struct mailers *curmailers = mailers;
for (curmailers = mailers; curmailers; curmailers = curmailers->next) {
- if (!strcmp(curmailers->id, curproxy->email_alert.mailers.name))
+ if (strcmp(curmailers->id, curproxy->email_alert.mailers.name) == 0)
break;
}
if (!curmailers) {
struct bind_conf *bind_conf;
struct listener *l;
- if (!strcmp(args[1], "socket")) {
+ if (strcmp(args[1], "socket") == 0) {
int cur_arg;
if (*args[2] == 0) {
global.maxsock++; /* for the listening socket */
}
}
- else if (!strcmp(args[1], "timeout")) {
+ else if (strcmp(args[1], "timeout") == 0) {
unsigned timeout;
const char *res = parse_time_err(args[2], &timeout, TIME_UNIT_MS);
}
global.stats_fe->timeout.client = MS_TO_TICKS(timeout);
}
- else if (!strcmp(args[1], "maxconn")) {
+ else if (strcmp(args[1], "maxconn") == 0) {
int maxconn = atol(args[2]);
if (maxconn <= 0) {
}
global.stats_fe->maxconn = maxconn;
}
- else if (!strcmp(args[1], "bind-process")) { /* enable the socket only on some processes */
+ else if (strcmp(args[1], "bind-process") == 0) { /* enable the socket only on some processes */
int cur_arg = 2;
unsigned long set = 0;
* Its location is not remembered here, this is just to switch
* to a gathering mode.
*/
- if (!strcmp(appctx->chunk->area + appctx->chunk->data - strlen(PAYLOAD_PATTERN), PAYLOAD_PATTERN))
+ if (strcmp(appctx->chunk->area + appctx->chunk->data - strlen(PAYLOAD_PATTERN), PAYLOAD_PATTERN) == 0)
appctx->st1 |= APPCTX_CLI_ST1_PAYLOAD;
else {
/* no payload, the command is complete: parse the request */
static int set_severity_output(int *target, char *argument)
{
- if (!strcmp(argument, "none")) {
+ if (strcmp(argument, "none") == 0) {
*target = CLI_SEVERITY_NONE;
return 1;
}
- else if (!strcmp(argument, "number")) {
+ else if (strcmp(argument, "number") == 0) {
*target = CLI_SEVERITY_NUMBER;
return 1;
}
- else if (!strcmp(argument, "string")) {
+ else if (strcmp(argument, "string") == 0) {
*target = CLI_SEVERITY_STRING;
return 1;
}
static int cli_parse_set_lvl(char **args, char *payload, struct appctx *appctx, void *private)
{
/* this will ask the applet to not output a \n after the command */
- if (!strcmp(args[1], "-"))
+ if (strcmp(args[1], "-") == 0)
appctx->st1 |= APPCTX_CLI_ST1_NOLF;
- if (!strcmp(args[0], "operator")) {
+ if (strcmp(args[0], "operator") == 0) {
if (!cli_has_level(appctx, ACCESS_LVL_OPER)) {
return 1;
}
appctx->cli_level &= ~ACCESS_LVL_MASK;
appctx->cli_level |= ACCESS_LVL_OPER;
- } else if (!strcmp(args[0], "user")) {
+ } else if (strcmp(args[0], "user") == 0) {
if (!cli_has_level(appctx, ACCESS_LVL_USER)) {
return 1;
}
memprintf(err, "'%s' : missing fd type", args[cur_arg]);
return ERR_ALERT | ERR_FATAL;
}
- if (!strcmp(args[cur_arg+1], "listeners")) {
+ if (strcmp(args[cur_arg + 1], "listeners") == 0) {
conf->level |= ACCESS_FD_LISTENERS;
} else {
memprintf(err, "'%s' only supports 'listeners' (got '%s')",
return ERR_ALERT | ERR_FATAL;
}
- if (!strcmp(args[cur_arg+1], "user")) {
+ if (strcmp(args[cur_arg + 1], "user") == 0) {
conf->level &= ~ACCESS_LVL_MASK;
conf->level |= ACCESS_LVL_USER;
- } else if (!strcmp(args[cur_arg+1], "operator")) {
+ } else if (strcmp(args[cur_arg + 1], "operator") == 0) {
conf->level &= ~ACCESS_LVL_MASK;
conf->level |= ACCESS_LVL_OPER;
- } else if (!strcmp(args[cur_arg+1], "admin")) {
+ } else if (strcmp(args[cur_arg + 1], "admin") == 0) {
conf->level &= ~ACCESS_LVL_MASK;
conf->level |= ACCESS_LVL_ADMIN;
} else {
else
*next_pid = target_pid;
return 1;
- } else if (!strcmp("prompt", args[0])) {
+ } else if (strcmp("prompt", args[0]) == 0) {
s->pcli_flags ^= PCLI_F_PROMPT;
return argl; /* return the number of elements in the array */
- } else if (!strcmp("quit", args[0])) {
+ } else if (strcmp("quit", args[0]) == 0) {
channel_shutr_now(&s->req);
channel_shutw_now(&s->res);
return argl; /* return the number of elements in the array */
- } else if (!strcmp(args[0], "operator")) {
+ } else if (strcmp(args[0], "operator") == 0) {
if (!pcli_has_level(s, ACCESS_LVL_OPER)) {
memprintf(errmsg, "Permission denied!\n");
return -1;
s->pcli_flags |= ACCESS_LVL_OPER;
return argl;
- } else if (!strcmp(args[0], "user")) {
+ } else if (strcmp(args[0], "user") == 0) {
if (!pcli_has_level(s, ACCESS_LVL_USER)) {
memprintf(errmsg, "Permission denied!\n");
return -1;
int i;
for (i = 0; comp_algos[i].cfg_name; i++) {
- if (!strcmp(algo, comp_algos[i].cfg_name)) {
+ if (strcmp(algo, comp_algos[i].cfg_name) == 0) {
comp_algo = calloc(1, sizeof(*comp_algo));
memmove(comp_algo, &comp_algos[i], sizeof(struct comp_algo));
comp_algo->next = comp->algos;
struct dns_resolvers *res;
list_for_each_entry(res, &dns_resolvers, list) {
- if (!strcmp(res->id, id))
+ if (strcmp(res->id, id) == 0)
return res;
}
return NULL;
struct dns_srvrq *srvrq;
list_for_each_entry(srvrq, &dns_srvrq_list, list) {
- if (srvrq->proxy == px && !strcmp(srvrq->name, name))
+ if (srvrq->proxy == px && strcmp(srvrq->name, name) == 0)
return srvrq;
}
return NULL;
mod->counters, mod->counters_size);
/* Store the ns counters pointer */
- if (!strcmp(mod->name, "dns")) {
+ if (strcmp(mod->name, "dns") == 0) {
ns->counters = (struct dns_counters *)ns->extra_counters->data + mod->counters_off[COUNTERS_DNS];
ns->counters->id = ns->id;
}
struct fcgi_app *app;
for (app = fcgi_apps; app != NULL; app = app->next) {
- if (!strcmp(app->name, name))
+ if (strcmp(app->name, name) == 0)
return app;
}
if (f->id != fcgi_flt_id)
continue;
fcgi_conf = f->conf;
- if (strcmp(name, fcgi_conf->name)) {
+ if (strcmp(name, fcgi_conf->name) != 0) {
fcgi_conf = NULL;
continue;
}
list_for_each_entry(fconf, &curpx->filter_configs, list) {
if (fconf->id == fcgi_flt_id) {
fcgi_conf = fconf->conf;
- if (fcgi_conf && !strcmp((char *)fcgi_conf->name, args[1]))
+ if (fcgi_conf && strcmp((char *)fcgi_conf->name, args[1]) == 0)
goto end;
memprintf(err, "'%s' : only one fcgi-app supported per backend", args[0]);
retval = -1;
const char *err;
char *errmsg = NULL;
- if (!strcmp(args[0], "fcgi-app")) { /* new fcgi-app */
+ if (strcmp(args[0], "fcgi-app") == 0) { /* new fcgi-app */
if (!*(args[1])) {
ha_alert("parsing [%s:%d]: '%s' expects <name> as argument.\n",
file, linenum, args[0]);
}
for (curapp = fcgi_apps; curapp != NULL; curapp = curapp->next) {
- if (!strcmp(curapp->name, args[1])) {
+ if (strcmp(curapp->name, args[1]) == 0) {
ha_alert("Parsing [%s:%d]: fcgi-app section '%s' has the same name as another one declared at %s:%d.\n",
file, linenum, args[1], curapp->conf.file, curapp->conf.line);
err_code |= ERR_ALERT | ERR_FATAL;
err_code |= ERR_ALERT | ERR_FATAL;
}
}
- else if (!strcmp(args[0], "docroot")) {
+ else if (strcmp(args[0], "docroot") == 0) {
if (!*(args[1])) {
ha_alert("parsing [%s:%d] : '%s' expects <path> as argument.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_ABORT;
}
}
- else if (!strcmp(args[0], "path-info")) {
+ else if (strcmp(args[0], "path-info") == 0) {
if (!*(args[1])) {
ha_alert("parsing [%s:%d] : '%s' expects <regex> as argument.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
}
}
- else if (!strcmp(args[0], "index")) {
+ else if (strcmp(args[0], "index") == 0) {
if (!*(args[1])) {
ha_alert("parsing [%s:%d] : '%s' expects <filename> as argument.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_ABORT;
}
}
- else if (!strcmp(args[0], "acl")) {
+ else if (strcmp(args[0], "acl") == 0) {
const char *err;
err = invalid_char(args[1]);
if (err) {
goto out;
}
}
- else if (!strcmp(args[0], "set-param")) {
+ else if (strcmp(args[0], "set-param") == 0) {
if (!*(args[1]) || !*(args[2])) {
ha_alert("parsing [%s:%d] : '%s' expects <name> and <value> as arguments.\n",
file, linenum, args[0]);
goto parse_cond_rule;
}
#endif
- else if (!strcmp(args[0], "pass-header")) {
+ else if (strcmp(args[0], "pass-header") == 0) {
if (!*(args[1])) {
ha_alert("parsing [%s:%d] : '%s' expects <name> as arguments.\n",
file, linenum, args[0]);
goto parse_cond_rule;
}
#endif
- else if (!strcmp(args[0], "option")) {
+ else if (strcmp(args[0], "option") == 0) {
if (!*(args[1])) {
ha_alert("parsing [%s:%d]: '%s' expects an option name.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
}
- else if (!strcmp(args[1], "keep-conn")) {
+ else if (strcmp(args[1], "keep-conn") == 0) {
if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
goto out;
if (kwm == KWM_STD)
else if (kwm == KWM_NO)
curapp->flags &= ~FCGI_APP_FL_KEEP_CONN;
}
- else if (!strcmp(args[1], "get-values")) {
+ else if (strcmp(args[1], "get-values") == 0) {
if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
goto out;
if (kwm == KWM_STD)
else if (kwm == KWM_NO)
curapp->flags &= ~FCGI_APP_FL_GET_VALUES;
}
- else if (!strcmp(args[1], "mpxs-conns")) {
+ else if (strcmp(args[1], "mpxs-conns") == 0) {
if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
goto out;
if (kwm == KWM_STD)
else if (kwm == KWM_NO)
curapp->flags &= ~FCGI_APP_FL_MPXS_CONNS;
}
- else if (!strcmp(args[1], "max-reqs")) {
+ else if (strcmp(args[1], "max-reqs") == 0) {
if (kwm != KWM_STD) {
ha_alert("parsing [%s:%d]: negation/default is not supported for option '%s'.\n",
file, linenum, args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
}
}
- else if (!strcmp(args[0], "log-stderr")) {
+ else if (strcmp(args[0], "log-stderr") == 0) {
if (!parse_logsrv(args, &curapp->logsrvs, (kwm == KWM_NO), &errmsg)) {
ha_alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
file, line, args[0]);
return -1;
}
- if (!strcmp(args[0], "filter")) {
+ if (strcmp(args[0], "filter") == 0) {
struct flt_kw *kw;
int cur_arg;
else
comp = proxy->comp;
- if (!strcmp(args[1], "algo")) {
+ if (strcmp(args[1], "algo") == 0) {
struct comp_ctx *ctx;
int cur_arg = 2;
continue;
}
}
- else if (!strcmp(args[1], "offload"))
+ else if (strcmp(args[1], "offload") == 0)
comp->offload = 1;
- else if (!strcmp(args[1], "type")) {
+ else if (strcmp(args[1], "type") == 0) {
int cur_arg = 2;
if (!*args[cur_arg]) {
continue;
/* Check engine Id. It should be uniq */
- if (!strcmp(conf->id, c->id)) {
+ if (strcmp(conf->id, c->id) == 0) {
ha_alert("Proxy %s : duplicated name for SPOE engine '%s'.\n",
px->id, conf->id);
return 1;
if ((cfg_scope == NULL && curengine != NULL) ||
(cfg_scope != NULL && curengine == NULL) ||
- (curengine != NULL && cfg_scope != NULL && strcmp(curengine, cfg_scope)))
+ (curengine != NULL && cfg_scope != NULL && strcmp(curengine, cfg_scope) != 0))
goto out;
- if (!strcmp(args[0], "spoe-agent")) { /* new spoe-agent section */
+ if (strcmp(args[0], "spoe-agent") == 0) { /* new spoe-agent section */
if (!*args[1]) {
ha_alert("parsing [%s:%d] : missing name for spoe-agent section.\n",
file, linenum);
LIST_INIT(&curagent->groups);
LIST_INIT(&curagent->messages);
}
- else if (!strcmp(args[0], "use-backend")) {
+ else if (strcmp(args[0], "use-backend") == 0) {
if (!*args[1]) {
ha_alert("parsing [%s:%d] : '%s' expects a backend name.\n",
file, linenum, args[0]);
free(curagent->b.name);
curagent->b.name = strdup(args[1]);
}
- else if (!strcmp(args[0], "messages")) {
+ else if (strcmp(args[0], "messages") == 0) {
int cur_arg = 1;
while (*args[cur_arg]) {
struct spoe_placeholder *ph = NULL;
list_for_each_entry(ph, &curmphs, list) {
- if (!strcmp(ph->id, args[cur_arg])) {
+ if (strcmp(ph->id, args[cur_arg]) == 0) {
ha_alert("parsing [%s:%d]: spoe-message '%s' already used.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
cur_arg++;
}
}
- else if (!strcmp(args[0], "groups")) {
+ else if (strcmp(args[0], "groups") == 0) {
int cur_arg = 1;
while (*args[cur_arg]) {
struct spoe_placeholder *ph = NULL;
list_for_each_entry(ph, &curgphs, list) {
- if (!strcmp(ph->id, args[cur_arg])) {
+ if (strcmp(ph->id, args[cur_arg]) == 0) {
ha_alert("parsing [%s:%d]: spoe-group '%s' already used.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
cur_arg++;
}
}
- else if (!strcmp(args[0], "timeout")) {
+ else if (strcmp(args[0], "timeout") == 0) {
unsigned int *tv = NULL;
const char *res;
unsigned timeout;
}
if (alertif_too_many_args(2, file, linenum, args, &err_code))
goto out;
- if (!strcmp(args[1], "hello"))
+ if (strcmp(args[1], "hello") == 0)
tv = &curagent->timeout.hello;
- else if (!strcmp(args[1], "idle"))
+ else if (strcmp(args[1], "idle") == 0)
tv = &curagent->timeout.idle;
- else if (!strcmp(args[1], "processing"))
+ else if (strcmp(args[1], "processing") == 0)
tv = &curagent->timeout.processing;
else {
ha_alert("parsing [%s:%d] : 'timeout' supports 'hello', 'idle' or 'processing' (got %s).\n",
}
*tv = MS_TO_TICKS(timeout);
}
- else if (!strcmp(args[0], "option")) {
+ else if (strcmp(args[0], "option") == 0) {
if (!*args[1]) {
ha_alert("parsing [%s:%d]: '%s' expects an option name.\n",
file, linenum, args[0]);
goto out;
}
- if (!strcmp(args[1], "pipelining")) {
+ if (strcmp(args[1], "pipelining") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (kwm == 1)
curagent->flags |= SPOE_FL_PIPELINING;
goto out;
}
- else if (!strcmp(args[1], "async")) {
+ else if (strcmp(args[1], "async") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (kwm == 1)
curagent->flags |= SPOE_FL_ASYNC;
goto out;
}
- else if (!strcmp(args[1], "send-frag-payload")) {
+ else if (strcmp(args[1], "send-frag-payload") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (kwm == 1)
curagent->flags |= SPOE_FL_SND_FRAGMENTATION;
goto out;
}
- else if (!strcmp(args[1], "dontlog-normal")) {
+ else if (strcmp(args[1], "dontlog-normal") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
if (kwm == 1)
goto out;
}
- if (!strcmp(args[1], "var-prefix")) {
+ if (strcmp(args[1], "var-prefix") == 0) {
char *tmp;
if (!*args[2]) {
}
curagent->var_pfx = strdup(args[2]);
}
- else if (!strcmp(args[1], "force-set-var")) {
+ else if (strcmp(args[1], "force-set-var") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
curagent->flags |= SPOE_FL_FORCE_SET_VAR;
}
- else if (!strcmp(args[1], "continue-on-error")) {
+ else if (strcmp(args[1], "continue-on-error") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
curagent->flags |= SPOE_FL_CONT_ON_ERR;
}
- else if (!strcmp(args[1], "set-on-error")) {
+ else if (strcmp(args[1], "set-on-error") == 0) {
char *tmp;
if (!*args[2]) {
}
curagent->var_on_error = strdup(args[2]);
}
- else if (!strcmp(args[1], "set-process-time")) {
+ else if (strcmp(args[1], "set-process-time") == 0) {
char *tmp;
if (!*args[2]) {
}
curagent->var_t_process = strdup(args[2]);
}
- else if (!strcmp(args[1], "set-total-time")) {
+ else if (strcmp(args[1], "set-total-time") == 0) {
char *tmp;
if (!*args[2]) {
goto out;
}
}
- else if (!strcmp(args[0], "maxconnrate")) {
+ else if (strcmp(args[0], "maxconnrate") == 0) {
if (!*args[1]) {
ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
file, linenum, args[0]);
goto out;
curagent->cps_max = atol(args[1]);
}
- else if (!strcmp(args[0], "maxerrrate")) {
+ else if (strcmp(args[0], "maxerrrate") == 0) {
if (!*args[1]) {
ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
file, linenum, args[0]);
goto out;
curagent->eps_max = atol(args[1]);
}
- else if (!strcmp(args[0], "max-frame-size")) {
+ else if (strcmp(args[0], "max-frame-size") == 0) {
if (!*args[1]) {
ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
file, linenum, args[0]);
goto out;
}
}
- else if (!strcmp(args[0], "max-waiting-frames")) {
+ else if (strcmp(args[0], "max-waiting-frames") == 0) {
if (!*args[1]) {
ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
file, linenum, args[0]);
goto out;
}
}
- else if (!strcmp(args[0], "register-var-names")) {
+ else if (strcmp(args[0], "register-var-names") == 0) {
int cur_arg;
if (!*args[1]) {
cur_arg++;
}
}
- else if (!strcmp(args[0], "log")) {
+ else if (strcmp(args[0], "log") == 0) {
char *errmsg = NULL;
if (!parse_logsrv(args, &curlogsrvs, (kwm == 1), &errmsg)) {
if ((cfg_scope == NULL && curengine != NULL) ||
(cfg_scope != NULL && curengine == NULL) ||
- (curengine != NULL && cfg_scope != NULL && strcmp(curengine, cfg_scope)))
+ (curengine != NULL && cfg_scope != NULL && strcmp(curengine, cfg_scope) != 0))
goto out;
- if (!strcmp(args[0], "spoe-group")) { /* new spoe-group section */
+ if (strcmp(args[0], "spoe-group") == 0) { /* new spoe-group section */
if (!*args[1]) {
ha_alert("parsing [%s:%d] : missing name for spoe-group section.\n",
file, linenum);
}
list_for_each_entry(grp, &curgrps, list) {
- if (!strcmp(grp->id, args[1])) {
+ if (strcmp(grp->id, args[1]) == 0) {
ha_alert("parsing [%s:%d]: spoe-group section '%s' has the same"
" name as another one declared at %s:%d.\n",
file, linenum, args[1], grp->conf.file, grp->conf.line);
LIST_INIT(&curgrp->messages);
LIST_ADDQ(&curgrps, &curgrp->list);
}
- else if (!strcmp(args[0], "messages")) {
+ else if (strcmp(args[0], "messages") == 0) {
int cur_arg = 1;
while (*args[cur_arg]) {
struct spoe_placeholder *ph = NULL;
list_for_each_entry(ph, &curgrp->phs, list) {
- if (!strcmp(ph->id, args[cur_arg])) {
+ if (strcmp(ph->id, args[cur_arg]) == 0) {
ha_alert("parsing [%s:%d]: spoe-message '%s' already used.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
if ((cfg_scope == NULL && curengine != NULL) ||
(cfg_scope != NULL && curengine == NULL) ||
- (curengine != NULL && cfg_scope != NULL && strcmp(curengine, cfg_scope)))
+ (curengine != NULL && cfg_scope != NULL && strcmp(curengine, cfg_scope) != 0))
goto out;
- if (!strcmp(args[0], "spoe-message")) { /* new spoe-message section */
+ if (strcmp(args[0], "spoe-message") == 0) { /* new spoe-message section */
if (!*args[1]) {
ha_alert("parsing [%s:%d] : missing name for spoe-message section.\n",
file, linenum);
}
list_for_each_entry(msg, &curmsgs, list) {
- if (!strcmp(msg->id, args[1])) {
+ if (strcmp(msg->id, args[1]) == 0) {
ha_alert("parsing [%s:%d]: spoe-message section '%s' has the same"
" name as another one declared at %s:%d.\n",
file, linenum, args[1], msg->conf.file, msg->conf.line);
LIST_INIT(&curmsg->by_grp);
LIST_ADDQ(&curmsgs, &curmsg->list);
}
- else if (!strcmp(args[0], "args")) {
+ else if (strcmp(args[0], "args") == 0) {
int cur_arg = 1;
curproxy->conf.args.ctx = ARGC_SPOE;
curproxy->conf.args.file = NULL;
curproxy->conf.args.line = 0;
}
- else if (!strcmp(args[0], "acl")) {
+ else if (strcmp(args[0], "acl") == 0) {
err = invalid_char(args[1]);
if (err) {
ha_alert("parsing [%s:%d] : character '%c' is not permitted in acl name '%s'.\n",
goto out;
}
}
- else if (!strcmp(args[0], "event")) {
+ else if (strcmp(args[0], "event") == 0) {
if (!*args[1]) {
ha_alert("parsing [%s:%d] : missing event name.\n", file, linenum);
err_code |= ERR_ALERT | ERR_FATAL;
/* if (alertif_too_many_args(1, file, linenum, args, &err_code)) */
/* goto out; */
- if (!strcmp(args[1], spoe_event_str[SPOE_EV_ON_CLIENT_SESS]))
+ if (strcmp(args[1], spoe_event_str[SPOE_EV_ON_CLIENT_SESS]) == 0)
curmsg->event = SPOE_EV_ON_CLIENT_SESS;
- else if (!strcmp(args[1], spoe_event_str[SPOE_EV_ON_SERVER_SESS]))
+ else if (strcmp(args[1], spoe_event_str[SPOE_EV_ON_SERVER_SESS]) == 0)
curmsg->event = SPOE_EV_ON_SERVER_SESS;
- else if (!strcmp(args[1], spoe_event_str[SPOE_EV_ON_TCP_REQ_FE]))
+ else if (strcmp(args[1], spoe_event_str[SPOE_EV_ON_TCP_REQ_FE]) == 0)
curmsg->event = SPOE_EV_ON_TCP_REQ_FE;
- else if (!strcmp(args[1], spoe_event_str[SPOE_EV_ON_TCP_REQ_BE]))
+ else if (strcmp(args[1], spoe_event_str[SPOE_EV_ON_TCP_REQ_BE]) == 0)
curmsg->event = SPOE_EV_ON_TCP_REQ_BE;
- else if (!strcmp(args[1], spoe_event_str[SPOE_EV_ON_TCP_RSP]))
+ else if (strcmp(args[1], spoe_event_str[SPOE_EV_ON_TCP_RSP]) == 0)
curmsg->event = SPOE_EV_ON_TCP_RSP;
- else if (!strcmp(args[1], spoe_event_str[SPOE_EV_ON_HTTP_REQ_FE]))
+ else if (strcmp(args[1], spoe_event_str[SPOE_EV_ON_HTTP_REQ_FE]) == 0)
curmsg->event = SPOE_EV_ON_HTTP_REQ_FE;
- else if (!strcmp(args[1], spoe_event_str[SPOE_EV_ON_HTTP_REQ_BE]))
+ else if (strcmp(args[1], spoe_event_str[SPOE_EV_ON_HTTP_REQ_BE]) == 0)
curmsg->event = SPOE_EV_ON_HTTP_REQ_BE;
- else if (!strcmp(args[1], spoe_event_str[SPOE_EV_ON_HTTP_RSP]))
+ else if (strcmp(args[1], spoe_event_str[SPOE_EV_ON_HTTP_RSP]) == 0)
curmsg->event = SPOE_EV_ON_HTTP_RSP;
else {
ha_alert("parsing [%s:%d] : unknown event '%s'.\n",
conf->proxy = px;
while (*args[pos]) {
- if (!strcmp(args[pos], "config")) {
+ if (strcmp(args[pos], "config") == 0) {
if (!*args[pos+1]) {
memprintf(err, "'%s' : '%s' option without value",
args[*cur_arg], args[pos]);
file = args[pos+1];
pos += 2;
}
- else if (!strcmp(args[pos], "engine")) {
+ else if (strcmp(args[pos], "engine") == 0) {
if (!*args[pos+1]) {
memprintf(err, "'%s' : '%s' option without value",
args[*cur_arg], args[pos]);
struct spoe_arg *arg;
unsigned int where;
- if (!strcmp(msg->id, ph->id)) {
+ if (strcmp(msg->id, ph->id) == 0) {
if ((px->cap & (PR_CAP_FE|PR_CAP_BE)) == (PR_CAP_FE|PR_CAP_BE)) {
if (msg->event == SPOE_EV_ON_TCP_REQ_BE)
msg->event = SPOE_EV_ON_TCP_REQ_FE;
* agent */
list_for_each_entry(ph, &curgphs, list) {
list_for_each_entry_safe(grp, grpback, &curgrps, list) {
- if (!strcmp(grp->id, ph->id)) {
+ if (strcmp(grp->id, ph->id) == 0) {
grp->agent = curagent;
LIST_DEL(&grp->list);
LIST_ADDQ(&curagent->groups, &grp->list);
list_for_each_entry(grp, &curagent->groups, list) {
list_for_each_entry_safe(ph, phback, &grp->phs, list) {
list_for_each_entry(msg, &curmsgs, list) {
- if (!strcmp(msg->id, ph->id)) {
+ if (strcmp(msg->id, ph->id) == 0) {
if (msg->group != NULL) {
memprintf(err, "SPOE message '%s' already belongs to "
"the SPOE group '%s' declare at %s:%d",
continue;
/* This is the good engine */
- if (!strcmp(conf->id, engine_id)) {
+ if (strcmp(conf->id, engine_id) == 0) {
agent = conf->agent;
break;
}
/* Try to find the right group */
list_for_each_entry(group, &agent->groups, list) {
/* This is the good group */
- if (!strcmp(group->id, group_id))
+ if (strcmp(group->id, group_id) == 0)
break;
}
if (&group->list == &agent->groups) {
}
conf->proxy = px;
conf->flags = 0;
- if (!strcmp(args[pos], "trace")) {
+ if (strcmp(args[pos], "trace") == 0) {
pos++;
while (*args[pos]) {
- if (!strcmp(args[pos], "name")) {
+ if (strcmp(args[pos], "name") == 0) {
if (!*args[pos + 1]) {
memprintf(err, "'%s' : '%s' option without value",
args[*cur_arg], args[pos]);
}
pos++;
}
- else if (!strcmp(args[pos], "quiet"))
+ else if (strcmp(args[pos], "quiet") == 0)
conf->flags |= TRACE_F_QUIET;
- else if (!strcmp(args[pos], "random-parsing"))
+ else if (strcmp(args[pos], "random-parsing") == 0)
continue; // ignore
- else if (!strcmp(args[pos], "random-forwarding"))
+ else if (strcmp(args[pos], "random-forwarding") == 0)
conf->flags |= TRACE_F_RAND_FWD;
- else if (!strcmp(args[pos], "hexdump"))
+ else if (strcmp(args[pos], "hexdump") == 0)
conf->flags |= TRACE_F_HEXDUMP;
else
break;
if (!cur_unixsocket) {
cur_unixsocket = strdup(un->sun_path);
} else {
- if (old_unixsocket && !strcmp(un->sun_path, old_unixsocket)) {
+ if (old_unixsocket && strcmp(un->sun_path, old_unixsocket) == 0) {
free(cur_unixsocket);
cur_unixsocket = strdup(old_unixsocket);
return;
goto error;
}
if (p->uri_auth && p->uri_auth->userlist &&
- !strcmp(p->uri_auth->userlist->name, argp[idx].data.str.area))
+ strcmp(p->uri_auth->userlist->name, argp[idx].data.str.area) == 0)
ul = p->uri_auth->userlist;
else
ul = auth_find_userlist(argp[idx].data.str.area);
cur_arg = *orig_arg;
if (rule->from == ACT_F_HTTP_REQ) {
- if (!strcmp(args[cur_arg-1], "tarpit")) {
+ if (strcmp(args[cur_arg - 1], "tarpit") == 0) {
rule->action = ACT_HTTP_REQ_TARPIT;
default_status = 500;
}
rule->release_ptr = release_http_action;
cur_arg = *orig_arg;
- if (!strcmp(args[cur_arg], "realm")) {
+ if (strcmp(args[cur_arg], "realm") == 0) {
cur_arg++;
if (!*args[cur_arg]) {
memprintf(err, "missing realm value.\n");
}
status = atol(args[1]);
- errloc = (!strcmp(args[0], "errorloc303") ? 303 : 302);
+ errloc = (strcmp(args[0], "errorloc303") == 0 ? 303 : 302);
msg = http_parse_errorloc(errloc, status, args[2], errmsg);
if (!msg) {
memprintf(errmsg, "%s : %s", args[0], *errmsg);
curr_errs->conf.file = strdup(file);
curr_errs->conf.line = linenum;
}
- else if (!strcmp(args[0], "errorfile")) { /* error message from a file */
+ else if (strcmp(args[0], "errorfile") == 0) { /* error message from a file */
struct http_reply *reply;
struct buffer *msg;
int status, rc;
return NULL;
}
}
- else if (!strcmp(args[cur_arg],"drop-query")) {
+ else if (strcmp(args[cur_arg], "drop-query") == 0) {
flags |= REDIRECT_FLAG_DROP_QS;
}
- else if (!strcmp(args[cur_arg],"append-slash")) {
+ else if (strcmp(args[cur_arg], "append-slash") == 0) {
flags |= REDIRECT_FLAG_APPEND_SLASH;
}
else if (strcmp(args[cur_arg], "if") == 0 ||
* "log global": copy global.logrsvs linked list to the end of logsrvs
* list. But first, we check (logsrvs != global.logsrvs).
*/
- if (*(args[1]) && *(args[2]) == 0 && !strcmp(args[1], "global")) {
+ if (*(args[1]) && *(args[2]) == 0 && strcmp(args[1], "global") == 0) {
if (logsrvs == &global.logsrvs) {
memprintf(err, "'global' is not supported for a global syslog server");
goto error;
format = LOG_FORMATS - 1;
while (format > 0 && log_formats[format].name
- && strcmp(log_formats[format].name, fmt))
+ && strcmp(log_formats[format].name, fmt) != 0)
format--;
/* Note: 0 is LOG_FORMAT_UNSPEC */
int level;
level = NB_LOG_LEVELS - 1;
- while (level >= 0 && strcmp(log_levels[level], lev))
+ while (level >= 0 && strcmp(log_levels[level], lev) != 0)
level--;
return level;
int facility;
facility = NB_LOG_FACILITIES - 1;
- while (facility >= 0 && strcmp(log_facilities[facility], fac))
+ while (facility >= 0 && strcmp(log_facilities[facility], fac) != 0)
facility--;
return facility;
px->id = strdup(args[1]);
}
- else if (!strcmp(args[0], "maxconn")) { /* maxconn */
+ else if (strcmp(args[0], "maxconn") == 0) { /* maxconn */
if (warnifnotcap(cfg_log_forward, PR_CAP_FE, file, linenum, args[0], " Maybe you want 'fullconn' instead ?"))
err_code |= ERR_WARN;
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
}
- else if (!strcmp(args[0], "backlog")) { /* backlog */
+ else if (strcmp(args[0], "backlog") == 0) { /* backlog */
if (warnifnotcap(cfg_log_forward, PR_CAP_FE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
}
/* Be sure only the case differs between <from> and <to> */
- if (strcasecmp(from, to)) {
+ if (strcasecmp(from, to) != 0) {
memprintf(err, "<from> and <to> must not differ execpt the case");
return -1;
}
if (!(old_child->options & PROC_O_TYPE_PROG) || (!(old_child->options & PROC_O_LEAVING)))
continue;
- if (!strcmp(old_child->id, child->id))
+ if (strcmp(old_child->id, child->id) == 0)
old_child->options &= ~PROC_O_LEAVING;
}
struct mworker_proc *child;
int err_code = 0;
- if (!strcmp(args[0], "program")) {
+ if (strcmp(args[0], "program") == 0) {
if (alertif_too_many_args(1, file, linenum, args, &err_code)) {
err_code |= ERR_ABORT;
goto error;
list_for_each_entry(child, &proc_list, list) {
if (child->reloads == 0 && (child->options & PROC_O_TYPE_PROG)) {
- if (!strcmp(args[1], child->id)) {
+ if (strcmp(args[1], child->id) == 0) {
ha_alert("parsing [%s:%d]: '%s' program section already exists in the configuration.\n", file, linenum, args[1]);
err_code |= ERR_ALERT | ERR_ABORT;
goto error;
LIST_ADDQ(&proc_list, &ext_child->list);
- } else if (!strcmp(args[0], "command")) {
+ } else if (strcmp(args[0], "command") == 0) {
int arg_nb = 0;
int i = 0;
}
ext_child->command[i] = NULL;
- } else if (!strcmp(args[0], "option")) {
+ } else if (strcmp(args[0], "option") == 0) {
if (*(args[1]) == '\0') {
ha_alert("parsing [%s:%d]: '%s' expects an option name.\n",
err_code |= ERR_ALERT | ERR_FATAL;
goto error;
}
- } else if (!strcmp(args[0], "user")) {
+ } else if (strcmp(args[0], "user") == 0) {
struct passwd *ext_child_user;
if (*(args[1]) == '\0') {
ha_alert("parsing [%s:%d]: '%s' expects a user name.\n",
ha_alert("parsing [%s:%d] : cannot find user id for '%s' (%d:%s)\n", file, linenum, args[1], errno, strerror(errno));
err_code |= ERR_ALERT | ERR_FATAL;
}
- } else if (!strcmp(args[0], "group")) {
+ } else if (strcmp(args[0], "group") == 0) {
struct group *ext_child_group;
if (*(args[1]) == '\0') {
ha_alert("parsing [%s:%d]: '%s' expects a group name.\n",
struct peers *p;
for (p = cfg_peers; p; p = p->next) {
- if (!strcmp(p->id, args[2])) {
+ if (strcmp(p->id, args[2]) == 0) {
appctx->ctx.cfgpeers.target = p;
break;
}
args++;
name = args[0];
- if (!strcmp(args[0], "client")) {
+ if (strcmp(args[0], "client") == 0) {
name = "client";
tv = &proxy->timeout.client;
td = &defpx->timeout.client;
cap = PR_CAP_FE;
- } else if (!strcmp(args[0], "tarpit")) {
+ } else if (strcmp(args[0], "tarpit") == 0) {
tv = &proxy->timeout.tarpit;
td = &defpx->timeout.tarpit;
cap = PR_CAP_FE | PR_CAP_BE;
- } else if (!strcmp(args[0], "http-keep-alive")) {
+ } else if (strcmp(args[0], "http-keep-alive") == 0) {
tv = &proxy->timeout.httpka;
td = &defpx->timeout.httpka;
cap = PR_CAP_FE | PR_CAP_BE;
- } else if (!strcmp(args[0], "http-request")) {
+ } else if (strcmp(args[0], "http-request") == 0) {
tv = &proxy->timeout.httpreq;
td = &defpx->timeout.httpreq;
cap = PR_CAP_FE | PR_CAP_BE;
- } else if (!strcmp(args[0], "server")) {
+ } else if (strcmp(args[0], "server") == 0) {
name = "server";
tv = &proxy->timeout.server;
td = &defpx->timeout.server;
cap = PR_CAP_BE;
- } else if (!strcmp(args[0], "connect")) {
+ } else if (strcmp(args[0], "connect") == 0) {
name = "connect";
tv = &proxy->timeout.connect;
td = &defpx->timeout.connect;
cap = PR_CAP_BE;
- } else if (!strcmp(args[0], "check")) {
+ } else if (strcmp(args[0], "check") == 0) {
tv = &proxy->timeout.check;
td = &defpx->timeout.check;
cap = PR_CAP_BE;
- } else if (!strcmp(args[0], "queue")) {
+ } else if (strcmp(args[0], "queue") == 0) {
tv = &proxy->timeout.queue;
td = &defpx->timeout.queue;
cap = PR_CAP_BE;
- } else if (!strcmp(args[0], "tunnel")) {
+ } else if (strcmp(args[0], "tunnel") == 0) {
tv = &proxy->timeout.tunnel;
td = &defpx->timeout.tunnel;
cap = PR_CAP_BE;
- } else if (!strcmp(args[0], "client-fin")) {
+ } else if (strcmp(args[0], "client-fin") == 0) {
tv = &proxy->timeout.clientfin;
td = &defpx->timeout.clientfin;
cap = PR_CAP_FE;
- } else if (!strcmp(args[0], "server-fin")) {
+ } else if (strcmp(args[0], "server-fin") == 0) {
tv = &proxy->timeout.serverfin;
td = &defpx->timeout.serverfin;
cap = PR_CAP_BE;
- } else if (!strcmp(args[0], "clitimeout")) {
+ } else if (strcmp(args[0], "clitimeout") == 0) {
memprintf(err, "the '%s' directive is not supported anymore since HAProxy 2.1. Use 'timeout client'.", args[0]);
return -1;
- } else if (!strcmp(args[0], "srvtimeout")) {
+ } else if (strcmp(args[0], "srvtimeout") == 0) {
memprintf(err, "the '%s' directive is not supported anymore since HAProxy 2.1. Use 'timeout server'.", args[0]);
return -1;
- } else if (!strcmp(args[0], "contimeout")) {
+ } else if (strcmp(args[0], "contimeout") == 0) {
memprintf(err, "the '%s' directive is not supported anymore since HAProxy 2.1. Use 'timeout connect'.", args[0]);
return -1;
} else {
}
curpx->retry_type = 0;
for (i = 1; *(args[i]); i++) {
- if (!strcmp(args[i], "conn-failure"))
+ if (strcmp(args[i], "conn-failure") == 0)
curpx->retry_type |= PR_RE_CONN_FAILED;
- else if (!strcmp(args[i], "empty-response"))
+ else if (strcmp(args[i], "empty-response") == 0)
curpx->retry_type |= PR_RE_DISCONNECTED;
- else if (!strcmp(args[i], "response-timeout"))
+ else if (strcmp(args[i], "response-timeout") == 0)
curpx->retry_type |= PR_RE_TIMEOUT;
- else if (!strcmp(args[i], "401"))
+ else if (strcmp(args[i], "401") == 0)
curpx->retry_type |= PR_RE_401;
- else if (!strcmp(args[i], "403"))
+ else if (strcmp(args[i], "403") == 0)
curpx->retry_type |= PR_RE_403;
- else if (!strcmp(args[i], "404"))
+ else if (strcmp(args[i], "404") == 0)
curpx->retry_type |= PR_RE_404;
- else if (!strcmp(args[i], "408"))
+ else if (strcmp(args[i], "408") == 0)
curpx->retry_type |= PR_RE_408;
- else if (!strcmp(args[i], "425"))
+ else if (strcmp(args[i], "425") == 0)
curpx->retry_type |= PR_RE_425;
- else if (!strcmp(args[i], "500"))
+ else if (strcmp(args[i], "500") == 0)
curpx->retry_type |= PR_RE_500;
- else if (!strcmp(args[i], "501"))
+ else if (strcmp(args[i], "501") == 0)
curpx->retry_type |= PR_RE_501;
- else if (!strcmp(args[i], "502"))
+ else if (strcmp(args[i], "502") == 0)
curpx->retry_type |= PR_RE_502;
- else if (!strcmp(args[i], "503"))
+ else if (strcmp(args[i], "503") == 0)
curpx->retry_type |= PR_RE_503;
- else if (!strcmp(args[i], "504"))
+ else if (strcmp(args[i], "504") == 0)
curpx->retry_type |= PR_RE_504;
- else if (!strcmp(args[i], "0rtt-rejected"))
+ else if (strcmp(args[i], "0rtt-rejected") == 0)
curpx->retry_type |= PR_RE_EARLY_ERROR;
- else if (!strcmp(args[i], "junk-response"))
+ else if (strcmp(args[i], "junk-response") == 0)
curpx->retry_type |= PR_RE_JUNK_REQUEST;
else if (!(strcmp(args[i], "all-retryable-errors")))
curpx->retry_type |= PR_RE_CONN_FAILED | PR_RE_DISCONNECTED |
PR_RE_TIMEOUT | PR_RE_500 | PR_RE_502 |
PR_RE_503 | PR_RE_504 | PR_RE_EARLY_ERROR |
PR_RE_JUNK_REQUEST;
- else if (!strcmp(args[i], "none")) {
+ else if (strcmp(args[i], "none") == 0) {
if (i != 1 || *args[i + 1]) {
memprintf(err, "'%s' 'none' keyworld only usable alone", args[0]);
return -1;
return -1;
}
- if (!strcmp(args[0], "clitcpka-cnt")) {
+ if (strcmp(args[0], "clitcpka-cnt") == 0) {
if (!(proxy->cap & PR_CAP_FE)) {
memprintf(err, "%s will be ignored because %s '%s' has no frontend capability",
args[0], proxy_type_str(proxy), proxy->id);
retval = 1;
}
proxy->clitcpka_cnt = tcpka_cnt;
- } else if (!strcmp(args[0], "srvtcpka-cnt")) {
+ } else if (strcmp(args[0], "srvtcpka-cnt") == 0) {
if (!(proxy->cap & PR_CAP_BE)) {
memprintf(err, "%s will be ignored because %s '%s' has no backend capability",
args[0], proxy_type_str(proxy), proxy->id);
return -1;
}
- if (!strcmp(args[0], "clitcpka-idle")) {
+ if (strcmp(args[0], "clitcpka-idle") == 0) {
if (!(proxy->cap & PR_CAP_FE)) {
memprintf(err, "%s will be ignored because %s '%s' has no frontend capability",
args[0], proxy_type_str(proxy), proxy->id);
retval = 1;
}
proxy->clitcpka_idle = tcpka_idle;
- } else if (!strcmp(args[0], "srvtcpka-idle")) {
+ } else if (strcmp(args[0], "srvtcpka-idle") == 0) {
if (!(proxy->cap & PR_CAP_BE)) {
memprintf(err, "%s will be ignored because %s '%s' has no backend capability",
args[0], proxy_type_str(proxy), proxy->id);
return -1;
}
- if (!strcmp(args[0], "clitcpka-intvl")) {
+ if (strcmp(args[0], "clitcpka-intvl") == 0) {
if (!(proxy->cap & PR_CAP_FE)) {
memprintf(err, "%s will be ignored because %s '%s' has no frontend capability",
args[0], proxy_type_str(proxy), proxy->id);
retval = 1;
}
proxy->clitcpka_intvl = tcpka_intvl;
- } else if (!strcmp(args[0], "srvtcpka-intvl")) {
+ } else if (strcmp(args[0], "srvtcpka-intvl") == 0) {
if (!(proxy->cap & PR_CAP_BE)) {
memprintf(err, "%s will be ignored because %s '%s' has no backend capability",
args[0], proxy_type_str(proxy), proxy->id);
return NULL;
for (cursrv = px->srv; cursrv; cursrv = cursrv->next) {
- if (strcmp(cursrv->id, name))
+ if (strcmp(cursrv->id, name) != 0)
continue;
if (!target) {
&s->si[0].wait_event);
if (conn_upgrade_mux_fe(conn, cs, &s->req.buf, ist(""), PROTO_MODE_HTTP) == -1)
return 0;
- if (!strcmp(conn->mux->name, "H2")) {
+ if (strcmp(conn->mux->name, "H2") == 0) {
/* For HTTP/2, destroy the conn_stream,
* disable logging, and pretend that we
* failed, to that the stream is
}
if (p->uri_auth && p->uri_auth->userlist &&
- !strcmp(p->uri_auth->userlist->name, arg->data.str.area))
+ strcmp(p->uri_auth->userlist->name, arg->data.str.area) == 0)
ul = p->uri_auth->userlist;
else
ul = auth_find_userlist(arg->data.str.area);
return ERR_ALERT | ERR_FATAL;
}
- if (!strcmp(arg, "*")) {
+ if (strcmp(arg, "*") == 0) {
/* Use the namespace associated with the connection (if present). */
newsrv->flags |= SRV_F_USE_NS_FROM_PP;
return 0;
n = strchr(p, ',');
if (n)
*n++ = '\0';
- if (!strcmp(p, "ssl")) {
+ if (strcmp(p, "ssl") == 0) {
newsrv->pp_opts |= SRV_PP_V2_SSL;
- } else if (!strcmp(p, "cert-cn")) {
+ } else if (strcmp(p, "cert-cn") == 0) {
newsrv->pp_opts |= SRV_PP_V2_SSL;
newsrv->pp_opts |= SRV_PP_V2_SSL_CN;
- } else if (!strcmp(p, "cert-key")) {
+ } else if (strcmp(p, "cert-key") == 0) {
newsrv->pp_opts |= SRV_PP_V2_SSL;
newsrv->pp_opts |= SRV_PP_V2_SSL_KEY_ALG;
- } else if (!strcmp(p, "cert-sig")) {
+ } else if (strcmp(p, "cert-sig") == 0) {
newsrv->pp_opts |= SRV_PP_V2_SSL;
newsrv->pp_opts |= SRV_PP_V2_SSL_SIG_ALG;
- } else if (!strcmp(p, "ssl-cipher")) {
+ } else if (strcmp(p, "ssl-cipher") == 0) {
newsrv->pp_opts |= SRV_PP_V2_SSL;
newsrv->pp_opts |= SRV_PP_V2_SSL_CIPHER;
- } else if (!strcmp(p, "authority")) {
+ } else if (strcmp(p, "authority") == 0) {
newsrv->pp_opts |= SRV_PP_V2_AUTHORITY;
- } else if (!strcmp(p, "crc32c")) {
+ } else if (strcmp(p, "crc32c") == 0) {
newsrv->pp_opts |= SRV_PP_V2_CRC32C;
- } else if (!strcmp(p, "unique-id")) {
+ } else if (strcmp(p, "unique-id") == 0) {
newsrv->pp_opts |= SRV_PP_V2_UNIQUE_ID;
} else
goto fail;
return ERR_ALERT | ERR_FATAL;
}
- if (!strcmp(arg, "none")) {
+ if (strcmp(arg, "none") == 0) {
newsrv->observe = HANA_OBS_NONE;
}
- else if (!strcmp(arg, "layer4")) {
+ else if (strcmp(arg, "layer4") == 0) {
newsrv->observe = HANA_OBS_LAYER4;
}
- else if (!strcmp(arg, "layer7")) {
+ else if (strcmp(arg, "layer7") == 0) {
if (curproxy->mode != PR_MODE_HTTP) {
memprintf(err, "'%s' can only be used in http proxies.\n", arg);
return ERR_ALERT;
*cur_arg += 2;
while (*(args[*cur_arg])) {
- if (!strcmp(args[*cur_arg], "usesrc")) { /* address to use outside */
+ if (strcmp(args[*cur_arg], "usesrc") == 0) { /* address to use outside */
#if defined(CONFIG_HAP_TRANSPARENT)
if (!*args[*cur_arg + 1]) {
ha_alert("'usesrc' expects <addr>[:<port>], 'client', 'clientip', "
"or 'hdr_ip(name,#)' as argument.\n");
goto err;
}
- if (!strcmp(args[*cur_arg + 1], "client")) {
+ if (strcmp(args[*cur_arg + 1], "client") == 0) {
newsrv->conn_src.opts &= ~CO_SRC_TPROXY_MASK;
newsrv->conn_src.opts |= CO_SRC_TPROXY_CLI;
}
- else if (!strcmp(args[*cur_arg + 1], "clientip")) {
+ else if (strcmp(args[*cur_arg + 1], "clientip") == 0) {
newsrv->conn_src.opts &= ~CO_SRC_TPROXY_MASK;
newsrv->conn_src.opts |= CO_SRC_TPROXY_CIP;
}
#endif /* defined(CONFIG_HAP_TRANSPARENT) */
} /* "usesrc" */
- if (!strcmp(args[*cur_arg], "interface")) { /* specifically bind to this interface */
+ if (strcmp(args[*cur_arg], "interface") == 0) { /* specifically bind to this interface */
#ifdef SO_BINDTODEVICE
if (!*args[*cur_arg + 1]) {
ha_alert("'%s' : missing interface name.\n", args[0]);
unsigned val;
char *fqdn = NULL;
- if (!strcmp(args[0], "server") ||
- !strcmp(args[0], "peer") ||
- !strcmp(args[0], "default-server") ||
- !strcmp(args[0], "server-template")) {
+ if (strcmp(args[0], "server") == 0 ||
+ strcmp(args[0], "peer") == 0 ||
+ strcmp(args[0], "default-server") == 0 ||
+ strcmp(args[0], "server-template") == 0) {
int cur_arg;
int defsrv = (*args[0] == 'd');
- int srv = !defsrv && (*args[0] == 'p' || !strcmp(args[0], "server"));
+ int srv = !defsrv && (*args[0] == 'p' || strcmp(args[0], "server") == 0);
int srv_tmpl = !defsrv && !srv;
int tmpl_range_low = 0, tmpl_range_high = 0;
}
while (*args[cur_arg]) {
- if (!strcmp(args[cur_arg], "init-addr")) {
+ if (strcmp(args[cur_arg], "init-addr") == 0) {
char *p, *end;
int done;
struct sockaddr_storage sa;
*(end++) = 0;
memset(&sa, 0, sizeof(sa));
- if (!strcmp(p, "libc")) {
+ if (strcmp(p, "libc") == 0) {
done = srv_append_initaddr(&newsrv->init_addr_methods, SRV_IADDR_LIBC);
}
- else if (!strcmp(p, "last")) {
+ else if (strcmp(p, "last") == 0) {
done = srv_append_initaddr(&newsrv->init_addr_methods, SRV_IADDR_LAST);
}
- else if (!strcmp(p, "none")) {
+ else if (strcmp(p, "none") == 0) {
done = srv_append_initaddr(&newsrv->init_addr_methods, SRV_IADDR_NONE);
}
else if (str2ip2(p, &sa, 0)) {
}
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "resolvers")) {
+ else if (strcmp(args[cur_arg], "resolvers") == 0) {
free(newsrv->resolvers_id);
newsrv->resolvers_id = strdup(args[cur_arg + 1]);
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "resolve-opts")) {
+ else if (strcmp(args[cur_arg], "resolve-opts") == 0) {
char *p, *end;
for (p = args[cur_arg + 1]; *p; p = end) {
if (*end)
*(end++) = 0;
- if (!strcmp(p, "allow-dup-ip")) {
+ if (strcmp(p, "allow-dup-ip") == 0) {
newsrv->dns_opts.accept_duplicate_ip = 1;
}
- else if (!strcmp(p, "ignore-weight")) {
+ else if (strcmp(p, "ignore-weight") == 0) {
newsrv->dns_opts.ignore_weight = 1;
}
- else if (!strcmp(p, "prevent-dup-ip")) {
+ else if (strcmp(p, "prevent-dup-ip") == 0) {
newsrv->dns_opts.accept_duplicate_ip = 0;
}
else {
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "resolve-prefer")) {
- if (!strcmp(args[cur_arg + 1], "ipv4"))
+ else if (strcmp(args[cur_arg], "resolve-prefer") == 0) {
+ if (strcmp(args[cur_arg + 1], "ipv4") == 0)
newsrv->dns_opts.family_prio = AF_INET;
- else if (!strcmp(args[cur_arg + 1], "ipv6"))
+ else if (strcmp(args[cur_arg + 1], "ipv6") == 0)
newsrv->dns_opts.family_prio = AF_INET6;
else {
ha_alert("parsing [%s:%d]: '%s' expects either ipv4 or ipv6 as argument.\n",
}
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "resolve-net")) {
+ else if (strcmp(args[cur_arg], "resolve-net") == 0) {
char *p, *e;
unsigned char mask;
struct dns_options *opt;
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "weight")) {
+ else if (strcmp(args[cur_arg], "weight") == 0) {
int w;
w = atol(args[cur_arg + 1]);
if (w < 0 || w > SRV_UWGHT_MAX) {
newsrv->uweight = newsrv->iweight = w;
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "log-proto")) {
- if (!strcmp(args[cur_arg + 1], "legacy"))
+ else if (strcmp(args[cur_arg], "log-proto") == 0) {
+ if (strcmp(args[cur_arg + 1], "legacy") == 0)
newsrv->log_proto = SRV_LOG_PROTO_LEGACY;
- else if (!strcmp(args[cur_arg + 1], "octet-count"))
+ else if (strcmp(args[cur_arg + 1], "octet-count") == 0)
newsrv->log_proto = SRV_LOG_PROTO_OCTET_COUNTING;
else {
ha_alert("parsing [%s:%d]: '%s' expects one of 'legacy' or "
}
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "minconn")) {
+ else if (strcmp(args[cur_arg], "minconn") == 0) {
newsrv->minconn = atol(args[cur_arg + 1]);
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "maxconn")) {
+ else if (strcmp(args[cur_arg], "maxconn") == 0) {
newsrv->maxconn = atol(args[cur_arg + 1]);
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "maxqueue")) {
+ else if (strcmp(args[cur_arg], "maxqueue") == 0) {
newsrv->maxqueue = atol(args[cur_arg + 1]);
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "slowstart")) {
+ else if (strcmp(args[cur_arg], "slowstart") == 0) {
/* slowstart is stored in seconds */
const char *err = parse_time_err(args[cur_arg + 1], &val, TIME_UNIT_MS);
newsrv->slowstart = (val + 999) / 1000;
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "on-error")) {
- if (!strcmp(args[cur_arg + 1], "fastinter"))
+ else if (strcmp(args[cur_arg], "on-error") == 0) {
+ if (strcmp(args[cur_arg + 1], "fastinter") == 0)
newsrv->onerror = HANA_ONERR_FASTINTER;
- else if (!strcmp(args[cur_arg + 1], "fail-check"))
+ else if (strcmp(args[cur_arg + 1], "fail-check") == 0)
newsrv->onerror = HANA_ONERR_FAILCHK;
- else if (!strcmp(args[cur_arg + 1], "sudden-death"))
+ else if (strcmp(args[cur_arg + 1], "sudden-death") == 0)
newsrv->onerror = HANA_ONERR_SUDDTH;
- else if (!strcmp(args[cur_arg + 1], "mark-down"))
+ else if (strcmp(args[cur_arg + 1], "mark-down") == 0)
newsrv->onerror = HANA_ONERR_MARKDWN;
else {
ha_alert("parsing [%s:%d]: '%s' expects one of 'fastinter', "
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "on-marked-down")) {
- if (!strcmp(args[cur_arg + 1], "shutdown-sessions"))
+ else if (strcmp(args[cur_arg], "on-marked-down") == 0) {
+ if (strcmp(args[cur_arg + 1], "shutdown-sessions") == 0)
newsrv->onmarkeddown = HANA_ONMARKEDDOWN_SHUTDOWNSESSIONS;
else {
ha_alert("parsing [%s:%d]: '%s' expects 'shutdown-sessions' but got '%s'\n",
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "on-marked-up")) {
- if (!strcmp(args[cur_arg + 1], "shutdown-backup-sessions"))
+ else if (strcmp(args[cur_arg], "on-marked-up") == 0) {
+ if (strcmp(args[cur_arg + 1], "shutdown-backup-sessions") == 0)
newsrv->onmarkedup = HANA_ONMARKEDUP_SHUTDOWNBACKUPSESSIONS;
else {
ha_alert("parsing [%s:%d]: '%s' expects 'shutdown-backup-sessions' but got '%s'\n",
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "error-limit")) {
+ else if (strcmp(args[cur_arg], "error-limit") == 0) {
if (!*args[cur_arg + 1]) {
ha_alert("parsing [%s:%d]: '%s' expects an integer argument.\n",
file, linenum, args[cur_arg]);
}
cur_arg += 2;
}
- else if (!strcmp(args[cur_arg], "usesrc")) { /* address to use outside: needs "source" first */
+ else if (strcmp(args[cur_arg], "usesrc") == 0) { /* address to use outside: needs "source" first */
ha_alert("parsing [%s:%d] : '%s' only allowed after a '%s' statement.\n",
file, linenum, "usesrc", "source");
err_code |= ERR_ALERT | ERR_FATAL;
server_recalc_eweight(srv, 1);
/* load server IP address */
- if (strcmp(params[0], "-"))
+ if (strcmp(params[0], "-") != 0)
srv->lastaddr = strdup(params[0]);
if (fqdn && srv->hostname) {
- if (!strcmp(srv->hostname, fqdn)) {
+ if (strcmp(srv->hostname, fqdn) == 0) {
/* Here we reset the 'set from stats socket FQDN' flag
* to support such transitions:
* Let's say initial FQDN value is foo1 (in configuration file).
resolution = srv->dns_requester->resolution;
if (resolution &&
resolution->hostname_dn &&
- !strcmp(resolution->hostname_dn, hostname_dn))
+ strcmp(resolution->hostname_dn, hostname_dn) == 0)
goto end;
dns_unlink_resolution(srv->dns_requester);
msg = get_trash_chunk();
chunk_reset(msg);
- if (server->hostname && !strcmp(fqdn, server->hostname)) {
+ if (server->hostname && strcmp(fqdn, server->hostname) == 0) {
chunk_appendf(msg, "no need to change the FDQN");
goto out;
}
/* look for the extension */
if ((ext = strrchr(fp->area, '.'))) {
- if (!strcmp(ext, ".crt")) {
+ if (strcmp(ext, ".crt") == 0) {
*ext = '\0';
fp->data = strlen(fp->area);
}
ckchs = ckchs_transaction.new_ckchs;
- if (strcmp(args[3] + 1, ckchs->path))
+ if (strcmp(args[3] + 1, ckchs->path) != 0)
goto error;
} else {
/* check which type of file we want to update */
for (i = 0; cert_exts[i].type < CERT_TYPE_MAX; i++) {
end = strrchr(buf->area, '.');
- if (end && *cert_exts[i].ext && (!strcmp(end + 1, cert_exts[i].ext))) {
+ if (end && *cert_exts[i].ext && (strcmp(end + 1, cert_exts[i].ext) == 0)) {
*end = '\0';
buf->data = strlen(buf->area);
type = cert_exts[i].type;
struct dirent *de = de_list[i];
end = strrchr(de->d_name, '.');
- if (end && (!strcmp(end, ".issuer") || !strcmp(end, ".ocsp") || !strcmp(end, ".sctl") || !strcmp(end, ".key")))
+ if (end && (strcmp(end, ".issuer") == 0 || strcmp(end, ".ocsp") == 0 || strcmp(end, ".sctl") == 0 || strcmp(end, ".key") == 0))
goto ignore_entry;
snprintf(fp, sizeof(fp), "%s/%s", path, de->d_name);
appctx->ctx.cli.p0 = NULL;
appctx->ctx.cli.p1 = NULL;
- if (*args[3] && !strcmp(args[3], "-n")) {
+ if (*args[3] && strcmp(args[3], "-n") == 0) {
mode = 's';
filename = args[4];
} else {
/* If this is a wildcard, look for an exclusion on the same crt-list line */
sni = container_of(n, struct sni_ctx, name);
list_for_each_entry(sni_tmp, &sni->ckch_inst->sni_ctx, by_ckch_inst) {
- if (sni_tmp->neg && (!strcmp((const char *)sni_tmp->name.key, trash.area))) {
+ if (sni_tmp->neg && (strcmp((const char *)sni_tmp->name.key, trash.area) == 0)) {
skip = 1;
break;
}
break;
/* match '.' which means 'self' proxy */
- if (!strcmp(scope->px_id, ".") && px == s->be)
+ if (strcmp(scope->px_id, ".") == 0 && px == s->be)
break;
scope = scope->next;
}
/* proxy is the default domain */
appctx->ctx.stats.domain = STATS_DOMAIN_PROXY;
- if (!strcmp(args[arg], "domain")) {
+ if (strcmp(args[arg], "domain") == 0) {
++args;
- if (!strcmp(args[arg], "proxy")) {
+ if (strcmp(args[arg], "proxy") == 0) {
++args;
- } else if (!strcmp(args[arg], "dns")) {
+ } else if (strcmp(args[arg], "dns") == 0) {
appctx->ctx.stats.domain = STATS_DOMAIN_DNS;
++args;
} else {
node = ebis_lookup(&stktable_by_name, name);
if (node) {
t = container_of(node, struct stktable, name);
- if (!strcmp(t->id, name))
+ if (strcmp(t->id, name) == 0)
return t;
}
rule->arg.expr = expr;
rule->action = ACT_CUSTOM;
- if (!strcmp(args[*orig_arg-1], "set-src")) {
+ if (strcmp(args[*orig_arg - 1], "set-src") == 0) {
rule->action_ptr = tcp_action_req_set_src;
- } else if (!strcmp(args[*orig_arg-1], "set-src-port")) {
+ } else if (strcmp(args[*orig_arg - 1], "set-src-port") == 0) {
rule->action_ptr = tcp_action_req_set_src_port;
- } else if (!strcmp(args[*orig_arg-1], "set-dst")) {
+ } else if (strcmp(args[*orig_arg - 1], "set-dst") == 0) {
rule->action_ptr = tcp_action_req_set_dst;
- } else if (!strcmp(args[*orig_arg-1], "set-dst-port")) {
+ } else if (strcmp(args[*orig_arg - 1], "set-dst-port") == 0) {
rule->action_ptr = tcp_action_req_set_dst_port;
} else {
return ACT_RET_PRS_ERR;
return -1;
}
- if (!strcmp(args[arg], "accept")) {
+ if (strcmp(args[arg], "accept") == 0) {
arg++;
rule->action = ACT_ACTION_ALLOW;
rule->flags |= ACT_FLAG_FINAL;
}
- else if (!strcmp(args[arg], "reject")) {
+ else if (strcmp(args[arg], "reject") == 0) {
arg++;
rule->action = ACT_ACTION_DENY;
rule->flags |= ACT_FLAG_FINAL;
return -1;
}
- if (!strcmp(args[1], "inspect-delay")) {
+ if (strcmp(args[1], "inspect-delay") == 0) {
if (curpx == defpx) {
memprintf(err, "%s %s is not allowed in 'defaults' sections",
args[0], args[1]);
return NULL;
for (newuser = u->userlist->users; newuser; newuser = newuser->next)
- if (!strcmp(newuser->user, user)) {
+ if (strcmp(newuser->user, user) == 0) {
ha_warning("uri auth: ignoring duplicated user '%s'.\n",
user);
return u;
scope_list = &u->scope;
while ((old_scope = *scope_list)) {
- if (!strcmp(old_scope->px_id, scope))
+ if (strcmp(old_scope->px_id, scope) == 0)
break;
scope_list = &old_scope->next;
}