[master] 181a049 Make the object length a ssize_t

Poul-Henning Kamp phk at project.varnish-software.com
Sat Jan 22 14:01:54 CET 2011


commit 181a049692fa6cb8340b09e0a853d34cdac53d66
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat Jan 22 12:32:11 2011 +0000

    Make the object length a ssize_t

diff --git a/bin/varnishd/cache.h b/bin/varnishd/cache.h
index c378f85..0d6b63f 100644
--- a/bin/varnishd/cache.h
+++ b/bin/varnishd/cache.h
@@ -432,7 +432,7 @@ struct object {
 
 	unsigned		cacheable;
 
-	unsigned		len;
+	ssize_t			len;
 
 	double			ttl;
 	double			age;
diff --git a/bin/varnishd/cache_response.c b/bin/varnishd/cache_response.c
index 0b7e713..31818e8 100644
--- a/bin/varnishd/cache_response.c
+++ b/bin/varnishd/cache_response.c
@@ -297,7 +297,7 @@ res_WriteDirObj(struct sess *sp, char lenbuf[20], size_t low, size_t high)
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 
 	if (sp->wrk->res_mode & RES_CHUNKED) {
-		bprintf(lenbuf, "%x\r\n", sp->obj->len);
+		bprintf(lenbuf, "%jx\r\n", (intmax_t)sp->obj->len);
 		(void)WRW_Write(sp->wrk, lenbuf, -1);
 	}
 



More information about the varnish-commit mailing list