Commit 64166cf0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

More assorted FlexeLint polishing



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