mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-01 08:03:31 +01:00
Use tor_ntohs in compress.c; avoid a winsocks dependency
This commit is contained in:
parent
326c473b79
commit
7d7af19f1b
@ -281,7 +281,7 @@ detect_compression_method(const char *in, size_t in_len)
|
|||||||
if (in_len > 2 && fast_memeq(in, "\x1f\x8b", 2)) {
|
if (in_len > 2 && fast_memeq(in, "\x1f\x8b", 2)) {
|
||||||
return GZIP_METHOD;
|
return GZIP_METHOD;
|
||||||
} else if (in_len > 2 && (in[0] & 0x0f) == 8 &&
|
} 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;
|
return ZLIB_METHOD;
|
||||||
} else if (in_len > 2 &&
|
} else if (in_len > 2 &&
|
||||||
fast_memeq(in, "\x5d\x00\x00", 3)) {
|
fast_memeq(in, "\x5d\x00\x00", 3)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user