summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2016-04-29 13:50:35 +0000
committermillert <millert@openbsd.org>2016-04-29 13:50:35 +0000
commit17632154fa6149252492dc76737edbcdd8a07ba2 (patch)
tree12022d9409b60039087796a23316ee5b54dd81bc
parentThe backoff timer is causing no end of trouble with disconnected clients (diff)
downloadwireguard-openbsd-17632154fa6149252492dc76737edbcdd8a07ba2.tar.xz
wireguard-openbsd-17632154fa6149252492dc76737edbcdd8a07ba2.zip
Need to set in/out bytes count for gz_write too. Otherwise gzip
will think the resulting file was got larger during compression.
-rw-r--r--usr.bin/compress/gzopen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/compress/gzopen.c b/usr.bin/compress/gzopen.c
index b761d8760db..d9cf6cad9f3 100644
--- a/usr.bin/compress/gzopen.c
+++ b/usr.bin/compress/gzopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gzopen.c,v 1.30 2016/04/28 14:21:24 millert Exp $ */
+/* $OpenBSD: gzopen.c,v 1.31 2016/04/29 13:50:35 millert Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -509,6 +509,8 @@ gz_write(void *cookie, const char *buf, int len)
break;
}
s->z_crc = crc32(s->z_crc, buf, len);
+ s->z_total_in += s->z_stream.total_in;
+ s->z_total_out += s->z_stream.total_out;
return (int)(len - s->z_stream.avail_in);
#endif