mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
comment out unused code that fails in py2
This commit is contained in:
parent
ddb60876a3
commit
859c93f390
2
setup.py
2
setup.py
@ -51,7 +51,7 @@ except:
|
||||
|
||||
setuptools.setup(
|
||||
name='warcprox',
|
||||
version='2.1b1.dev47',
|
||||
version='2.1b1.dev48',
|
||||
description='WARC writing MITM HTTP/S proxy',
|
||||
url='https://github.com/internetarchive/warcprox',
|
||||
author='Noah Levitt',
|
||||
|
@ -60,21 +60,21 @@ import certauth.certauth
|
||||
|
||||
import warcprox
|
||||
|
||||
import http.client
|
||||
orig_send = http.client.HTTPConnection.send
|
||||
def _send(self, data):
|
||||
if isinstance(data, bytes):
|
||||
logging.info('sending data (bytes): ')
|
||||
logging.root.handlers[0].stream.buffer.write(data)
|
||||
logging.root.handlers[0].stream.buffer.write(b'\n')
|
||||
elif isinstance(data, str):
|
||||
logging.info('sending data (str): ')
|
||||
logging.root.handlers[0].stream.write(data)
|
||||
logging.root.handlers[0].stream.write('\n')
|
||||
else:
|
||||
logging.info('sending data from %s', repr(data))
|
||||
orig_send(self, data)
|
||||
### uncomment this to see raw requests going over the wire
|
||||
### uncomment this to block see raw requests going over the wire
|
||||
# import http.client
|
||||
# orig_send = http.client.HTTPConnection.send
|
||||
# def _send(self, data):
|
||||
# if isinstance(data, bytes):
|
||||
# logging.info('sending data (bytes): ')
|
||||
# logging.root.handlers[0].stream.buffer.write(data)
|
||||
# logging.root.handlers[0].stream.buffer.write(b'\n')
|
||||
# elif isinstance(data, str):
|
||||
# logging.info('sending data (str): ')
|
||||
# logging.root.handlers[0].stream.write(data)
|
||||
# logging.root.handlers[0].stream.write('\n')
|
||||
# else:
|
||||
# logging.info('sending data from %s', repr(data))
|
||||
# orig_send(self, data)
|
||||
# http.client.HTTPConnection.send = _send
|
||||
|
||||
logging.basicConfig(
|
||||
|
Loading…
x
Reference in New Issue
Block a user