Commit 9aed2f91 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

More flexelint silencing



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4441 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 036b0153
......@@ -456,8 +456,8 @@ extern pthread_t VCA_thread;
/* cache_backend.c */
struct vbe_conn *VBE_GetFd(struct director *, struct sess *sp);
int VBE_Healthy(struct director *, const struct sess *sp);
struct vbe_conn *VBE_GetFd(const struct director *, struct sess *sp);
int VBE_Healthy(const struct director *, const struct sess *sp);
void VBE_ClosedFd(struct sess *sp);
void VBE_RecycleFd(struct sess *sp);
void VBE_AddHostHeader(const struct sess *sp);
......
......@@ -402,7 +402,7 @@ VBE_RecycleFd(struct sess *sp)
/* Get a connection --------------------------------------------------*/
struct vbe_conn *
VBE_GetFd(struct director *d, struct sess *sp)
VBE_GetFd(const struct director *d, struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
......@@ -415,7 +415,7 @@ VBE_GetFd(struct director *d, struct sess *sp)
/* Cheack health -----------------------------------------------------*/
int
VBE_Healthy(struct director *d, const struct sess *sp)
VBE_Healthy(const struct director *d, const struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
......@@ -439,7 +439,7 @@ struct vdi_simple {
};
static struct vbe_conn *
vdi_simple_getfd(struct director *d, struct sess *sp)
vdi_simple_getfd(const struct director *d, struct sess *sp)
{
struct vdi_simple *vs;
......@@ -450,7 +450,7 @@ vdi_simple_getfd(struct director *d, struct sess *sp)
}
static unsigned
vdi_simple_healthy(struct director *d, const struct sess *sp)
vdi_simple_healthy(const struct director *d, const struct sess *sp)
{
struct vdi_simple *vs;
......
......@@ -77,9 +77,9 @@ struct vrt_backend_probe;
* backends to use.
*/
typedef struct vbe_conn *vdi_getfd_f(struct director *, struct sess *sp);
typedef struct vbe_conn *vdi_getfd_f(const struct director *, struct sess *sp);
typedef void vdi_fini_f(struct director *);
typedef unsigned vdi_healthy(struct director *, const struct sess *sp);
typedef unsigned vdi_healthy(const struct director *, const struct sess *sp);
struct director {
unsigned magic;
......
......@@ -422,7 +422,8 @@ cnt_fetch(struct sess *sp)
struct http *hp, *hp2;
char *b;
unsigned handling, l;
struct vsb *vary;
int varyl = 0;
struct vsb *vary = NULL;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
......@@ -519,16 +520,19 @@ cnt_fetch(struct sess *sp)
CHECK_OBJ_NOTNULL(sp->objhead, OBJHEAD_MAGIC);
CHECK_OBJ_NOTNULL(sp->objcore, OBJCORE_MAGIC);
vary = VRY_Create(sp, sp->wrk->beresp);
if (vary != NULL) {
varyl = vsb_len(vary);
assert(varyl > 0);
}
} else {
AZ(sp->objhead);
AZ(sp->objcore);
vary = NULL;
}
l = http_EstimateWS(sp->wrk->beresp, HTTPH_A_INS);
if (vary != NULL)
l += vsb_len(vary);
l += varyl;
/* Space for producing a Content-Length: header */
l += 30;
......@@ -553,9 +557,9 @@ cnt_fetch(struct sess *sp)
if (vary != NULL) {
sp->obj->vary =
(void *)WS_Alloc(sp->obj->http->ws, vsb_len(vary));
(void *)WS_Alloc(sp->obj->http->ws, varyl);
AN(sp->obj->vary);
memcpy(sp->obj->vary, vsb_data(vary), vsb_len(vary));
memcpy(sp->obj->vary, vsb_data(vary), varyl);
vsb_delete(vary);
vary = NULL;
}
......
......@@ -78,7 +78,7 @@ struct vdi_random {
};
static struct vbe_conn *
vdi_random_getfd(struct director *d, struct sess *sp)
vdi_random_getfd(const struct director *d, struct sess *sp)
{
int i, k;
struct vdi_random *vs;
......@@ -158,7 +158,7 @@ vdi_random_getfd(struct director *d, struct sess *sp)
}
static unsigned
vdi_random_healthy(struct director *d, const struct sess *sp)
vdi_random_healthy(const struct director *d, const struct sess *sp)
{
struct vdi_random *vs;
int i;
......
......@@ -61,7 +61,7 @@ struct vdi_round_robin {
};
static struct vbe_conn *
vdi_round_robin_getfd(struct director *d, struct sess *sp)
vdi_round_robin_getfd(const struct director *d, struct sess *sp)
{
int i;
struct vdi_round_robin *vs;
......@@ -86,7 +86,7 @@ vdi_round_robin_getfd(struct director *d, struct sess *sp)
}
static unsigned
vdi_round_robin_healthy(struct director *d, const struct sess *sp)
vdi_round_robin_healthy(const struct director *d, const struct sess *sp)
{
struct vdi_round_robin *vs;
struct director *backend;
......
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