From 48330f1e8a1722a62f1680edf010409c034fcb8b Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Tue, 13 Aug 2019 03:31:49 +0500 Subject: [PATCH] shrunk max tls record size according to https://tools.ietf.org/html/rfc8446\#section-5.1 --- mtprotoproxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mtprotoproxy.py b/mtprotoproxy.py index c14bbeb..68c28c9 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -408,7 +408,7 @@ class FakeTLSStreamWriter(LayeredStreamWriterBase): self.upstream = upstream def write(self, data, extra={}): - MAX_CHUNK_SIZE = 65535 + MAX_CHUNK_SIZE = 16384 for start in range(0, len(data), MAX_CHUNK_SIZE): end = min(start+MAX_CHUNK_SIZE, len(data)) self.upstream.write(b"\x17\x03\x03" + int.to_bytes(end-start, 2, "big"))