From bd3d9731d730ba411d9d567ca220b76832ad8778 Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Tue, 26 Jun 2018 11:48:58 +0500 Subject: [PATCH] if the handshake failed, just consume all the data --- mtprotoproxy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mtprotoproxy.py b/mtprotoproxy.py index c0528ee..ba9cef8 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -487,6 +487,11 @@ async def handle_handshake(reader, writer): reader = CryptoWrappedStreamReader(reader, decryptor) writer = CryptoWrappedStreamWriter(writer, encryptor) return reader, writer, proto_tag, user, dc_idx, enc_key + enc_iv + + while True: + # just consume all the data + await reader.read(READ_BUF_SIZE) + return False