mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
remove unusued method; fix exception at shutdown time
This commit is contained in:
parent
3073d59303
commit
0e7a7fdd69
@ -136,9 +136,6 @@ class MitmProxyHandler(http_server.BaseHTTPRequestHandler):
|
||||
self.logger.error("exception from {}".format(self._proxy_request), exc_info=True)
|
||||
raise
|
||||
|
||||
def _special_request(self, method, type_):
|
||||
raise Exception('Not supported')
|
||||
|
||||
def _proxy_request(self):
|
||||
raise Exception('_proxy_request() not implemented in MitmProxyHandler, must be implemented in subclass!')
|
||||
|
||||
|
@ -213,6 +213,7 @@ class WarcProxyHandler(warcprox.mitmproxy.MitmProxyHandler):
|
||||
if 'Content-Length' in self.headers:
|
||||
req += self.rfile.read(int(self.headers['Content-Length']))
|
||||
|
||||
prox_rec_res = None
|
||||
try:
|
||||
self.logger.debug('sending to remote server req=%s', repr(req))
|
||||
|
||||
@ -256,7 +257,8 @@ class WarcProxyHandler(warcprox.mitmproxy.MitmProxyHandler):
|
||||
self.logger.error("%s proxying %s", repr(e), self.url, exc_info=True)
|
||||
finally:
|
||||
# Let's close off the remote end
|
||||
prox_rec_res.close()
|
||||
if prox_rec_res:
|
||||
prox_rec_res.close()
|
||||
self._proxy_sock.close()
|
||||
|
||||
# XXX Close connection to proxy client. Doing this because we were
|
||||
|
Loading…
x
Reference in New Issue
Block a user