mirror of
https://github.com/tiennm99/mtprotoproxy.git
synced 2026-10-18 12:14:34 +00:00
shrunk max tls record size according to https://tools.ietf.org/html/rfc8446\#section-5.1
This commit is contained in:
1 parent
4e2cb87685
commit
48330f1e8a
1 file changed
+1
-1
+1
-1
@@ -408,7 +408,7 @@ class FakeTLSStreamWriter(LayeredStreamWriterBase):
|
|||||||
self.upstream = upstream
|
self.upstream = upstream
|
||||||
|
|
||||||
def write(self, data, extra={}):
|
def write(self, data, extra={}):
|
||||||
MAX_CHUNK_SIZE = 65535
|
MAX_CHUNK_SIZE = 16384
|
||||||
for start in range(0, len(data), MAX_CHUNK_SIZE):
|
for start in range(0, len(data), MAX_CHUNK_SIZE):
|
||||||
end = min(start+MAX_CHUNK_SIZE, len(data))
|
end = min(start+MAX_CHUNK_SIZE, len(data))
|
||||||
self.upstream.write(b"\x17\x03\x03" + int.to_bytes(end-start, 2, "big"))
|
self.upstream.write(b"\x17\x03\x03" + int.to_bytes(end-start, 2, "big"))
|
||||||
|
|||||||
Reference in new issue
Block a user