Commit 566debe2 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Silence some FlexeLint warnings



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4209 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2f77b331
......@@ -235,7 +235,7 @@ static const struct pvar {
unsigned flag;
ban_cond_f *func;
} pvars[] = {
#define PVAR(a, b, c) { a, b, c },
#define PVAR(a, b, c) { (a), (b), (c) },
#include "purge_vars.h"
#undef PVAR
{ 0, 0, 0}
......@@ -286,9 +286,9 @@ BAN_AddTest(struct cli *cli, struct ban *b, const char *a1, const char *a2, cons
if (strncmp(a1, pv->name, strlen(pv->name)))
continue;
bt->func = pv->func;
if (pv->flag & 2)
if (pv->flag & PVAR_REQ)
b->flags |= BAN_F_REQ;
if (pv->flag & 1)
if (pv->flag & PVAR_HTTP)
ban_parse_http(bt, a1 + strlen(pv->name));
break;
}
......
......@@ -307,6 +307,7 @@ VRT_l_beresp_saintmode(const struct sess *sp, double a)
assert(a > 0);
ALLOC_OBJ(new, TROUBLE_MAGIC);
AN(new);
new->objhead = sp->objhead;
new->timeout = sp->t_req + a;
......
......@@ -29,12 +29,12 @@
*
* Define which variables we can purge on, and which function does it.
*
* Middle field is a bitmap:
* 1 = HTTP header search
* 2 = Needs a client supplied request for test evaluation
*/
PVAR("req.url", 2|0, ban_cond_url)
PVAR("obj.hash", 0|0, ban_cond_hash)
PVAR("req.http.", 2|1, ban_cond_req_http)
PVAR("obj.http.", 0|1, ban_cond_obj_http)
#define PVAR_HTTP 1
#define PVAR_REQ 2
PVAR("req.url", PVAR_REQ, ban_cond_url)
PVAR("obj.hash", 0, ban_cond_hash)
PVAR("req.http.", PVAR_REQ|PVAR_HTTP, ban_cond_req_http)
PVAR("obj.http.", PVAR_HTTP, ban_cond_obj_http)
......@@ -350,7 +350,7 @@ static const struct purge_var {
const char *name;
unsigned flag;
} purge_var[] = {
#define PVAR(a, b, c) { a, b },
#define PVAR(a, b, c) { (a), (b) },
#include "purge_vars.h"
#undef PVAR
{ 0, 0 }
......@@ -383,7 +383,7 @@ parse_purge(struct tokenlist *tl)
vcc_ErrWhere(tl, tl->t);
return;
}
if ((pv->flag & 1) &&
if ((pv->flag & PVAR_HTTP) &&
tl->t->b + strlen(pv->name) >= tl->t->e) {
vsb_printf(tl->sb, "Missing header name.");
vcc_ErrWhere(tl, tl->t);
......
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