Commit fc84f4a8 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

More assorted FlexeLint polishing



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2968 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 957c5f93
......@@ -98,7 +98,7 @@ VBE_TryConnect(const struct sess *sp, int pf, const struct sockaddr *sa, socklen
tmo = params->connect_timeout;
if (sp->backend->connect_timeout > 10e-3)
tmo = sp->backend->connect_timeout * 1000;
tmo = (int)(sp->backend->connect_timeout * 1000);
if (tmo > 0)
i = TCP_connect(s, sa, salen, tmo);
......
......@@ -72,7 +72,6 @@ DOT acceptor -> start [style=bold,color=green,weight=4]
#include "shmlog.h"
#include "vcl.h"
#include "cli.h"
#include "cli_priv.h"
#include "cache.h"
......
......@@ -61,6 +61,7 @@ struct vdi_random {
};
/*lint -e{818} not const-able */
static struct backend *
vdi_random_choose(struct sess *sp)
{
......@@ -81,6 +82,7 @@ vdi_random_choose(struct sess *sp)
return (NULL);
}
/*lint -e{818} not const-able */
static void
vdi_random_fini(struct director *d)
{
......
......@@ -60,6 +60,7 @@ struct vdi_round_robin {
};
/*lint -e{818} not const-able */
static struct backend *
vdi_round_robin_choose(struct sess *sp)
{
......@@ -75,6 +76,7 @@ vdi_round_robin_choose(struct sess *sp)
return (backend);
}
/*lint -e{818} not const-able */
static void
vdi_round_robin_fini(struct director *d)
{
......
......@@ -54,6 +54,7 @@ struct vdi_simple {
struct backend *backend;
};
/*lint -e{818} not const-able */
static struct backend *
vdi_simple_choose(struct sess *sp)
{
......@@ -64,6 +65,7 @@ vdi_simple_choose(struct sess *sp)
return (vs->backend);
}
/*lint -e{818} not const-able */
static void
vdi_simple_fini(struct director *d)
{
......
......@@ -53,6 +53,7 @@
#include "http_headers.h"
#undef HTTPH
/*lint -save -e773 not () */
#define LOGMTX2(ax, bx, cx) [bx] = SLT_##ax##cx
#define LOGMTX1(ax) { \
......@@ -69,6 +70,7 @@ static enum shmlogtag logmtx[][HTTP_HDR_FIRST + 1] = {
[HTTP_Tx] = LOGMTX1(Tx),
[HTTP_Obj] = LOGMTX1(Obj)
};
/*lint -restore */
static enum shmlogtag
http2shmlog(const struct http *hp, int t)
......@@ -551,20 +553,20 @@ http_copyh(struct http *to, const struct http *fm, unsigned n)
}
static void
http_copyreq(struct http *to, const struct http *fm, int transparent)
http_copyreq(struct http *to, const struct http *fm, int how)
{
CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC);
CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
if (transparent)
if ((how == HTTPH_R_PIPE) || (how == HTTPH_R_PASS)) {
http_copyh(to, fm, HTTP_HDR_REQ);
else
http_SetH(to, HTTP_HDR_REQ, "GET");
http_copyh(to, fm, HTTP_HDR_URL);
if (transparent)
http_copyh(to, fm, HTTP_HDR_PROTO);
else
} else {
http_SetH(to, HTTP_HDR_REQ, "GET");
http_SetH(to, HTTP_HDR_PROTO, "HTTP/1.1");
}
http_copyh(to, fm, HTTP_HDR_URL);
}
void
......@@ -645,8 +647,7 @@ http_FilterHeader(struct sess *sp, unsigned how)
hp = bereq->http;
hp->logtag = HTTP_Tx;
http_copyreq(hp, sp->http,
(how == HTTPH_R_PIPE) || (how == HTTPH_R_PASS));
http_copyreq(hp, sp->http, how);
http_FilterFields(sp->wrk, sp->fd, hp, sp->http, how);
http_PrintfHeader(sp->wrk, sp->fd, hp, "X-Varnish: %u", sp->xid);
http_PrintfHeader(sp->wrk, sp->fd, hp,
......
......@@ -107,7 +107,8 @@ VRY_Create(const struct sess *sp)
e--;
/* Encode two byte length and contents */
l = e - h;
vsb_printf(sb, "%c%c", l >> 8, l & 0xff);
assert(!(l & ~0xffff));
vsb_printf(sb, "%c%c", (unsigned)l >> 8, l & 0xff);
vsb_bcat(sb, h, e - h);
} else {
/* Mark as "not present" */
......
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