From 50df84bc802331e0a7170c6c979d0f123e088c24 Mon Sep 17 00:00:00 2001 From: pouryare Date: Fri, 28 Jun 2019 16:41:41 +0430 Subject: [PATCH] Update mtprotoproxy.py --- mtprotoproxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mtprotoproxy.py b/mtprotoproxy.py index bc4b58e..ca0703b 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -1064,7 +1064,7 @@ async def handle_client(reader_clt, writer_clt): task_clt_to_tg = asyncio.ensure_future(clt_to_tg) update_stats(user, curr_connects=1) - if ((user not in USER_MAX_TCP_CONNS or stats[user]["curr_connects"] <= USER_MAX_TCP_CONNS[user]) and (user not in USER_EXPIRATION or datetime.datetime.now() <= datetime.datetime.strptime(USER_EXPIRARION[user],"%d/%m/%Y"))): + if ((user not in USER_MAX_TCP_CONNS or stats[user]["curr_connects"] <= USER_MAX_TCP_CONNS[user]) and (user not in USER_EXPIRATION or datetime.datetime.now() <= datetime.datetime.strptime(USER_EXPIRATION[user],"%d/%m/%Y"))): await asyncio.wait([task_tg_to_clt, task_clt_to_tg], return_when=asyncio.FIRST_COMPLETED) update_stats(user, curr_connects=-1)