Make zlib detection happy on little-endian platforms; fix unit tests.

svn:r3384
This commit is contained in:
Nick Mathewson
2005-01-20 19:02:35 +00:00
parent 129e754ae4
commit 432e313c81
+1 -1
View 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;