From b9058b03344a624d5c3b977763f3902745d17618 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Tue, 8 Jan 2019 04:38:14 +0000 Subject: [PATCH] http2: bump to latest --- http2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/http2.py b/http2.py index 5db7b94..1018482 100644 --- a/http2.py +++ b/http2.py @@ -75,7 +75,7 @@ def _is_textual_content_type(ct): return ct in TEXTUAL_CONTENT_TYPES_LIST class RsHttp(): - def __init__(self, host, port=80, ssl=False, follow_redirects=False, auto_set_cookies=False, keep_alive=False, timeout=60, user_agent=None, proxies=None, max_tries=10, **kwargs): + def __init__(self, host, port=80, ssl=False, follow_redirects=False, auto_set_cookies=False, keep_alive=False, timeout=60, user_agent=None, proxies=None, max_tries=10, log_errors=True, **kwargs): self.host = host self.port = port self.use_ssl = ssl @@ -88,10 +88,12 @@ class RsHttp(): self.proxies = proxies self.cookies = dict() self.max_tries = max_tries + self.log_errors = log_errors self.headers = [] def _err_log(self, s): - sys.stderr.write(s + '\n') + if self.log_errors: + sys.stderr.write(s + '\n') def connect(self): return self.reconnect() @@ -310,6 +312,7 @@ class RsHttp(): self.use_ssl = use_ssl self.conn.disconnect() self.conn = None + self.reconnect() return self.get(url, extras) return hdr, res