From 0f141a3e4ab790a681d4eff1445b5c2ee7443304 Mon Sep 17 00:00:00 2001 From: Akkariiin Date: Mon, 20 Aug 2018 13:37:21 +0800 Subject: [PATCH] add typing hint --- shadowsocks/obfsplugin/plain.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shadowsocks/obfsplugin/plain.py b/shadowsocks/obfsplugin/plain.py index 593a23f..00f5355 100644 --- a/shadowsocks/obfsplugin/plain.py +++ b/shadowsocks/obfsplugin/plain.py @@ -96,6 +96,13 @@ class plain(object): pass def get_head_size(self, buf: bytes, def_value: int) -> int: + """ + get size From SOCKS5 head type info + + :param buf: bytes the header from SOCKS5 + :param def_value: int if cannot detect type + :return: the header really size + """ if len(buf) < 2: return def_value head_type = ord(buf[0]) & 0x7