]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use tor_ntohs in compress.c; avoid a winsocks dependency
authorNick Mathewson <nickm@torproject.org>
Thu, 28 Jun 2018 17:39:49 +0000 (13:39 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 28 Jun 2018 17:39:49 +0000 (13:39 -0400)
src/lib/compress/compress.c

index 23a5c0304486cd12ed026d27eab77d243b51ddbf..2cb5dbaec2017db5054bb4a42431bdac56994e6c 100644 (file)
@@ -281,7 +281,7 @@ detect_compression_method(const char *in, size_t in_len)
   if (in_len > 2 && fast_memeq(in, "\x1f\x8b", 2)) {
     return GZIP_METHOD;
   } else if (in_len > 2 && (in[0] & 0x0f) == 8 &&
-             (ntohs(get_uint16(in)) % 31) == 0) {
+             (tor_ntohs(get_uint16(in)) % 31) == 0) {
     return ZLIB_METHOD;
   } else if (in_len > 2 &&
              fast_memeq(in, "\x5d\x00\x00", 3)) {