[master] 739e4d58e Also be consistent about bodylen being long on gzip side
Poul-Henning Kamp
phk at FreeBSD.org
Wed Aug 7 09:10:11 UTC 2019
commit 739e4d58e417a492e28fab5bd39b12fc46aaced1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Aug 7 09:08:26 2019 +0000
Also be consistent about bodylen being long on gzip side
diff --git a/bin/varnishtest/vtc.h b/bin/varnishtest/vtc.h
index 2a8480b14..e1f167daa 100644
--- a/bin/varnishtest/vtc.h
+++ b/bin/varnishtest/vtc.h
@@ -131,7 +131,7 @@ void stop_h2(struct http *hp);
void b64_settings(const struct http *hp, const char *s);
/* vtc_gzip.c */
-void vtc_gzip(const struct http *, const char *, char **, unsigned *);
+void vtc_gzip(const struct http *, const char *, char **, long *);
void vtc_gunzip(struct http *, char *, long *);
/* vtc_subr.c */
diff --git a/bin/varnishtest/vtc_gzip.c b/bin/varnishtest/vtc_gzip.c
index a0b35bc1a..ab42c68c6 100644
--- a/bin/varnishtest/vtc_gzip.c
+++ b/bin/varnishtest/vtc_gzip.c
@@ -40,7 +40,7 @@
void
-vtc_gzip(const struct http *hp, const char *input, char **body, unsigned *bodylen)
+vtc_gzip(const struct http *hp, const char *input, char **body, long *bodylen)
{
unsigned l;
z_stream vz;
diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 6bbbb79fd..b8b9de4a7 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -774,7 +774,7 @@ static char* const *
http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp,
char *body, unsigned nohost)
{
- int bodylen = 0;
+ long bodylen = 0;
char *b, *c;
char *nullbody;
char *m;
@@ -847,7 +847,7 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp,
assert(body == nullbody);
free(body);
b = synth_body(av[1], 1);
- vtc_gzip(hp, b, &body, (unsigned *)&bodylen);
+ vtc_gzip(hp, b, &body, &bodylen);
free(b);
VSB_printf(hp->vsb, "Content-Encoding: gzip%s", nl);
// vtc_hexdump(hp->vl, 4, "gzip", (void*)body, bodylen);
@@ -855,7 +855,7 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp,
} else if (!strcmp(*av, "-gzipbody")) {
assert(body == nullbody);
free(body);
- vtc_gzip(hp, av[1], &body, (unsigned *)&bodylen);
+ vtc_gzip(hp, av[1], &body, &bodylen);
VSB_printf(hp->vsb, "Content-Encoding: gzip%s", nl);
// vtc_hexdump(hp->vl, 4, "gzip", (void*)body, bodylen);
av++;
@@ -869,7 +869,7 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp,
free(m);
}
if (body != NULL && !nolen)
- VSB_printf(hp->vsb, "Content-Length: %d%s", bodylen, nl);
+ VSB_printf(hp->vsb, "Content-Length: %ld%s", bodylen, nl);
VSB_cat(hp->vsb, nl);
if (body != NULL) {
VSB_bcat(hp->vsb, body, bodylen);
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index 0c88ba5c7..0e7bdea7f 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -1381,7 +1381,7 @@ cmd_tx11obj(CMD_ARGS)
int method_done = 1;
int path_done = 1;
int scheme_done = 1;
- int bodylen = 0;
+ long bodylen = 0;
ssize_t len;
uint32_t stid = 0, pstid;
uint32_t weight = 16;
@@ -1550,8 +1550,7 @@ cmd_tx11obj(CMD_ARGS)
}
else if (!strcmp(*av, "-gzipbody")) {
AZ(body);
- vtc_gzip(s->hp, av[1], &body,
- (unsigned *)&bodylen);
+ vtc_gzip(s->hp, av[1], &body, &bodylen);
AN(body);
ENC(hdr, ":content-encoding", "gzip");
f.flags &= ~END_STREAM;
@@ -1560,8 +1559,7 @@ cmd_tx11obj(CMD_ARGS)
else if (!strcmp(*av, "-gziplen")) {
AZ(body);
b = synth_body(av[1], 1);
- vtc_gzip(s->hp, b, &body,
- (unsigned *)&bodylen);
+ vtc_gzip(s->hp, b, &body, &bodylen);
AN(body);
free(b);
ENC(hdr, ":content-encoding", "gzip");
More information about the varnish-commit
mailing list