[or-cvs] Make zlib detection happy on little-endian platforms; fix u...

Nick Mathewson nickm at seul.org
Thu Jan 20 19:02:37 UTC 2005


Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv31445/src/common

Modified Files:
	torgzip.c 
Log Message:
Make zlib detection happy on little-endian platforms; fix unit tests.

Index: torgzip.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/torgzip.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- torgzip.c	19 Jan 2005 23:07:43 -0000	1.11
+++ torgzip.c	20 Jan 2005 19:02:35 -0000	1.12
@@ -235,7 +235,7 @@
   if (in_len > 2 && !memcmp(in, "\x1f\x8b", 2)) {
     return GZIP_METHOD;
   } else if (in_len > 2 && (in[0] & 0x0f) == 8 &&
-             (get_uint16(in) % 31) == 0) {
+             (ntohs(get_uint16(in)) % 31) == 0) {
     return ZLIB_METHOD;
   } else {
     return 0;



More information about the tor-commits mailing list