From e0f3cce14cb26d10bc259d431f688fb0d10ab3f5 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 20 Oct 2016 10:38:57 +1300 Subject: netlib.utils.[get,set]bit -> mitmproxy.utils.bits --- netlib/tcp.py | 2 +- netlib/utils.py | 16 ---------------- netlib/version_check.py | 43 ------------------------------------------- netlib/websockets/frame.py | 22 +++++++++++----------- 4 files changed, 12 insertions(+), 71 deletions(-) delete mode 100644 netlib/version_check.py (limited to 'netlib') diff --git a/netlib/tcp.py b/netlib/tcp.py index 4fde657f..4379c9b5 100644 --- a/netlib/tcp.py +++ b/netlib/tcp.py @@ -18,7 +18,7 @@ import OpenSSL from OpenSSL import SSL from netlib import certutils -from netlib import version_check +from mitmproxy.utils import version_check from mitmproxy.types import serializable from netlib import exceptions from mitmproxy.types import basethread diff --git a/netlib/utils.py b/netlib/utils.py index 779eaa27..7b007cb5 100644 --- a/netlib/utils.py +++ b/netlib/utils.py @@ -1,21 +1,5 @@ import re - -def setbit(byte, offset, value): - """ - Set a bit in a byte to 1 if value is truthy, 0 if not. - """ - if value: - return byte | (1 << offset) - else: - return byte & ~(1 << offset) - - -def getbit(byte, offset): - mask = 1 << offset - return bool(byte & mask) - - _label_valid = re.compile(b"(?!-)[A-Z\d-]{1,63}(? 125 indicates you need to read more bytes -- cgit v1.2.3