]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make zlib detection happy on little-endian platforms; fix unit tests.
authorNick Mathewson <nickm@torproject.org>
Thu, 20 Jan 2005 19:02:35 +0000 (19:02 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 20 Jan 2005 19:02:35 +0000 (19:02 +0000)
svn:r3384

src/common/torgzip.c

index 4bb39f2be5f98e0528071cd5e77dc61a323f02c9..9ac72e0f9f86628e263ab8a027fd428f9dec25e6 100644 (file)
@@ -235,7 +235,7 @@ int detect_compression_method(const char *in, size_t in_len)
   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;