Commit 5005595f authored by Federico G. Schwindt's avatar Federico G. Schwindt

Whitespace and related OCD

parent 77663a93
...@@ -443,11 +443,11 @@ VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc, ...@@ -443,11 +443,11 @@ VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc,
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vrt, VRT_BACKEND_MAGIC); CHECK_OBJ_NOTNULL(vrt, VRT_BACKEND_MAGIC);
if (vrt->path == NULL) if (vrt->path == NULL)
assert(vrt->ipv4_suckaddr != NULL assert(vrt->ipv4_suckaddr != NULL ||
|| vrt->ipv6_suckaddr != NULL); vrt->ipv6_suckaddr != NULL);
else else
assert(vrt->ipv4_suckaddr == NULL assert(vrt->ipv4_suckaddr == NULL &&
&& vrt->ipv6_suckaddr == NULL); vrt->ipv6_suckaddr == NULL);
vcl = ctx->vcl; vcl = ctx->vcl;
AN(vcl); AN(vcl);
......
...@@ -186,9 +186,9 @@ cnt_deliver(struct worker *wrk, struct req *req) ...@@ -186,9 +186,9 @@ cnt_deliver(struct worker *wrk, struct req *req)
assert(wrk->handling == VCL_RET_DELIVER); assert(wrk->handling == VCL_RET_DELIVER);
if (req->esi_level == 0 if (req->esi_level == 0 &&
&& http_IsStatus(req->resp, 200) http_IsStatus(req->resp, 200) &&
&& req->http->conds && RFC2616_Do_Cond(req)) req->http->conds && RFC2616_Do_Cond(req))
http_PutResponse(req->resp, "HTTP/1.1", 304, NULL); http_PutResponse(req->resp, "HTTP/1.1", 304, NULL);
req->req_step = R_STP_TRANSMIT; req->req_step = R_STP_TRANSMIT;
......
...@@ -656,8 +656,8 @@ VTP_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6, const char *uds, ...@@ -656,8 +656,8 @@ VTP_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6, const char *uds,
struct vtp_cs vcs; struct vtp_cs vcs;
const struct cp_methods *methods; const struct cp_methods *methods;
assert((uds != NULL && ip4 == NULL && ip6 == NULL) assert((uds != NULL && ip4 == NULL && ip6 == NULL) ||
|| (uds == NULL && (ip4 != NULL || ip6 != NULL))); (uds == NULL && (ip4 != NULL || ip6 != NULL)));
INIT_OBJ(&vcs, VTP_CS_MAGIC); INIT_OBJ(&vcs, VTP_CS_MAGIC);
vcs.ip4 = ip4; vcs.ip4 = ip4;
vcs.ip6 = ip6; vcs.ip6 = ip6;
......
...@@ -1132,7 +1132,7 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo, ...@@ -1132,7 +1132,7 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
ctx.ws = req->ws; ctx.ws = req->ws;
} }
if (bo != NULL) { if (bo != NULL) {
if(req) if (req)
assert(method == VCL_MET_PIPE); assert(method == VCL_MET_PIPE);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
CHECK_OBJ_NOTNULL(bo->vcl, VCL_MAGIC); CHECK_OBJ_NOTNULL(bo->vcl, VCL_MAGIC);
......
...@@ -103,8 +103,8 @@ vrt_priv_dynamic(VRT_CTX, struct vrt_privs *vps, uintptr_t id, ...@@ -103,8 +103,8 @@ vrt_priv_dynamic(VRT_CTX, struct vrt_privs *vps, uintptr_t id,
VTAILQ_FOREACH(vp, &vps->privs, list) { VTAILQ_FOREACH(vp, &vps->privs, list) {
CHECK_OBJ_NOTNULL(vp, VRT_PRIV_MAGIC); CHECK_OBJ_NOTNULL(vp, VRT_PRIV_MAGIC);
if (vp->vcl == ctx->vcl && vp->id == id if (vp->vcl == ctx->vcl && vp->id == id &&
&& vp->vmod_id == vmod_id) vp->vmod_id == vmod_id)
return (vp->priv); return (vp->priv);
} }
ALLOC_OBJ(vp, VRT_PRIV_MAGIC); ALLOC_OBJ(vp, VRT_PRIV_MAGIC);
......
...@@ -102,8 +102,8 @@ mac_opensocket(struct listen_sock *ls) ...@@ -102,8 +102,8 @@ mac_opensocket(struct listen_sock *ls)
CHECK_OBJ(ls->perms, UDS_PERMS_MAGIC); CHECK_OBJ(ls->perms, UDS_PERMS_MAGIC);
assert(ls->uds); assert(ls->uds);
errno = 0; errno = 0;
if (ls->perms->mode != 0 if (ls->perms->mode != 0 &&
&& chmod(ls->endpoint, ls->perms->mode) != 0) chmod(ls->endpoint, ls->perms->mode) != 0)
return errno; return errno;
if (chown(ls->endpoint, ls->perms->uid, ls->perms->gid) != 0) if (chown(ls->endpoint, ls->perms->uid, ls->perms->gid) != 0)
return errno; return errno;
...@@ -265,8 +265,8 @@ MAC_Arg(const char *spec) ...@@ -265,8 +265,8 @@ MAC_Arg(const char *spec)
la->name = name; la->name = name;
if (*la->endpoint != '/' && strchr(la->endpoint, '/') != NULL) if (*la->endpoint != '/' && strchr(la->endpoint, '/') != NULL)
ARGV_ERR("Unix domain socket addresses must be absolute paths " ARGV_ERR("Unix domain socket addresses must be"
"in -a (%s)\n", la->endpoint); " absolute paths in -a (%s)\n", la->endpoint);
if (*la->endpoint == '/' && heritage.min_vcl < 41) if (*la->endpoint == '/' && heritage.min_vcl < 41)
heritage.min_vcl = 41; heritage.min_vcl = 41;
...@@ -277,16 +277,16 @@ MAC_Arg(const char *spec) ...@@ -277,16 +277,16 @@ MAC_Arg(const char *spec)
if ((eq = strchr(av[i], '=')) == NULL) { if ((eq = strchr(av[i], '=')) == NULL) {
if (xp != NULL) if (xp != NULL)
ARGV_ERR("Too many protocol sub-args in -a " ARGV_ERR("Too many protocol sub-args"
"(%s)\n", av[i]); " in -a (%s)\n", av[i]);
xp = XPORT_Find(av[i]); xp = XPORT_Find(av[i]);
if (xp == NULL) if (xp == NULL)
ARGV_ERR("Unknown protocol '%s'\n", av[i]); ARGV_ERR("Unknown protocol '%s'\n", av[i]);
continue; continue;
} }
if (la->endpoint[0] != '/') if (la->endpoint[0] != '/')
ARGV_ERR("Invalid sub-arg %s for IP addresses in -a\n", ARGV_ERR("Invalid sub-arg %s for IP addresses"
av[i]); " in -a\n", av[i]);
val = eq + 1; val = eq + 1;
len = eq - av[i]; len = eq - av[i];
......
...@@ -449,7 +449,7 @@ vpx_proto2(const struct worker *wrk, struct req *req) ...@@ -449,7 +449,7 @@ vpx_proto2(const struct worker *wrk, struct req *req)
"PROXY2: Ignoring TLV"); "PROXY2: Ignoring TLV");
return (0); return (0);
} }
switch(d[0]) { switch (d[0]) {
case PP2_TYPE_CRC32C: case PP2_TYPE_CRC32C:
{ {
uint32_t n_crc32c = vbe32dec(d+3); uint32_t n_crc32c = vbe32dec(d+3);
......
...@@ -256,8 +256,7 @@ macro_expand(struct vtclog *vl, const char *text) ...@@ -256,8 +256,7 @@ macro_expand(struct vtclog *vl, const char *text)
NEEDLESS(return (NULL)); NEEDLESS(return (NULL));
} }
VSB_printf(vsb, "${%.*s}", (int)(q - p), p); VSB_printf(vsb, "${%.*s}", (int)(q - p), p);
} } else {
else {
VSB_printf(vsb, "%s", m); VSB_printf(vsb, "%s", m);
free(m); free(m);
} }
......
...@@ -544,8 +544,8 @@ VSB_quote_pfx(struct vsb *s, const char *pfx, const void *v, int len, int how) ...@@ -544,8 +544,8 @@ VSB_quote_pfx(struct vsb *s, const char *pfx, const void *v, int len, int how)
} }
if (!quote && !(how & (VSB_QUOTE_JSON|VSB_QUOTE_CSTR))) { if (!quote && !(how & (VSB_QUOTE_JSON|VSB_QUOTE_CSTR))) {
(void)VSB_bcat(s, p, len); (void)VSB_bcat(s, p, len);
if ((how & (VSB_QUOTE_UNSAFE|VSB_QUOTE_NONL)) if ((how & (VSB_QUOTE_UNSAFE|VSB_QUOTE_NONL)) &&
&& p[len-1] != '\n') p[len-1] != '\n')
(void)VSB_putc(s, '\n'); (void)VSB_putc(s, '\n');
return; return;
} }
......
...@@ -491,7 +491,7 @@ vcc_func(struct vcc *tl, struct expr **e, const void *priv, ...@@ -491,7 +491,7 @@ vcc_func(struct vcc *tl, struct expr **e, const void *priv,
if (extra == NULL) if (extra == NULL)
extra = ""; extra = "";
VTAILQ_INIT(&head); VTAILQ_INIT(&head);
for(;vv != NULL; vv = VTAILQ_NEXT(vv, list)) { for (;vv != NULL; vv = VTAILQ_NEXT(vv, list)) {
assert(vv->type == VJSN_ARRAY); assert(vv->type == VJSN_ARRAY);
fa = calloc(1, sizeof *fa); fa = calloc(1, sizeof *fa);
AN(fa); AN(fa);
......
...@@ -150,8 +150,8 @@ url_decode(const enum encoding dec, char *restrict const buf, ...@@ -150,8 +150,8 @@ url_decode(const enum encoding dec, char *restrict const buf,
} }
break; break;
case PERCENT: case PERCENT:
if (isoutofrange(*s) if (isoutofrange(*s) ||
|| (nib = nibble[*s - '0']) == ILL) { (nib = nibble[*s - '0']) == ILL) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
...@@ -162,8 +162,8 @@ url_decode(const enum encoding dec, char *restrict const buf, ...@@ -162,8 +162,8 @@ url_decode(const enum encoding dec, char *restrict const buf,
errno = ENOMEM; errno = ENOMEM;
return -1; return -1;
} }
if (isoutofrange(*s) if (isoutofrange(*s) ||
|| (nib2 = nibble[*s - '0']) == ILL) { (nib2 = nibble[*s - '0']) == ILL) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
......
...@@ -128,6 +128,7 @@ xyzzy_obj_test_priv_call(VRT_CTX, ...@@ -128,6 +128,7 @@ xyzzy_obj_test_priv_call(VRT_CTX,
(void)o; (void)o;
xyzzy_test_priv_call(ctx, priv); xyzzy_test_priv_call(ctx, priv);
} }
VCL_VOID v_matchproto_() VCL_VOID v_matchproto_()
xyzzy_obj_test_priv_vcl(VRT_CTX, xyzzy_obj_test_priv_vcl(VRT_CTX,
struct xyzzy_debug_obj *o, struct vmod_priv *priv) struct xyzzy_debug_obj *o, struct vmod_priv *priv)
...@@ -135,6 +136,7 @@ xyzzy_obj_test_priv_vcl(VRT_CTX, ...@@ -135,6 +136,7 @@ xyzzy_obj_test_priv_vcl(VRT_CTX,
(void)o; (void)o;
xyzzy_test_priv_vcl(ctx, priv); xyzzy_test_priv_vcl(ctx, priv);
} }
VCL_STRING v_matchproto_() VCL_STRING v_matchproto_()
xyzzy_obj_test_priv_task(VRT_CTX, xyzzy_obj_test_priv_task(VRT_CTX,
struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s)
...@@ -142,6 +144,7 @@ xyzzy_obj_test_priv_task(VRT_CTX, ...@@ -142,6 +144,7 @@ xyzzy_obj_test_priv_task(VRT_CTX,
(void)o; (void)o;
return (xyzzy_test_priv_task(ctx, priv, s)); return (xyzzy_test_priv_task(ctx, priv, s));
} }
VCL_STRING v_matchproto_() VCL_STRING v_matchproto_()
xyzzy_obj_test_priv_top(VRT_CTX, xyzzy_obj_test_priv_top(VRT_CTX,
struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment