diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-01-20 19:02:35 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-01-20 19:02:35 +0000 |
commit | 432e313c8130e68ba7132d093ea253c2c509469a (patch) | |
tree | 33db7c0738bd9ea03713b83a5dfe6d4640a686a5 /src/common/torgzip.c | |
parent | 129e754ae42db3ceb57a21c20affa094b02a9f7f (diff) | |
download | tor-432e313c8130e68ba7132d093ea253c2c509469a.tar.gz tor-432e313c8130e68ba7132d093ea253c2c509469a.zip |
Make zlib detection happy on little-endian platforms; fix unit tests.
svn:r3384
Diffstat (limited to 'src/common/torgzip.c')
-rw-r--r-- | src/common/torgzip.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/torgzip.c b/src/common/torgzip.c index 4bb39f2be5..9ac72e0f9f 100644 --- a/src/common/torgzip.c +++ b/src/common/torgzip.c @@ -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; |