mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
adjust to netlib api changes
This commit is contained in:
parent
9cc83ed9a8
commit
a0c8b20b7d
@ -82,7 +82,7 @@ class Pathoc(tcp.TCPClient):
|
||||
r = language.parse_request(self.settings, spec)
|
||||
language.serve(r, self.wfile, self.settings, self.address.host)
|
||||
self.wfile.flush()
|
||||
ret = list(http.read_response(self.rfile, r.method, None))
|
||||
ret = list(http.read_response(self.rfile, r.method.string(), None))
|
||||
ret.append(self.sslinfo)
|
||||
return Response(*ret)
|
||||
|
||||
@ -134,9 +134,9 @@ class Pathoc(tcp.TCPClient):
|
||||
try:
|
||||
req = language.serve(r, self.wfile, self.settings, self.address.host)
|
||||
self.wfile.flush()
|
||||
resp = http.read_response(self.rfile, r.method, None)
|
||||
resp = http.read_response(self.rfile, r.method.string(), None)
|
||||
except http.HttpError, v:
|
||||
print >> fp, "<< HTTP Error:", v.msg
|
||||
print >> fp, "<< HTTP Error:", v.message
|
||||
except tcp.NetLibTimeout:
|
||||
if ignoretimeout:
|
||||
return
|
||||
|
@ -11,6 +11,7 @@ CA_CERT_NAME = "mitmproxy-ca.pem"
|
||||
|
||||
logger = logging.getLogger('pathod')
|
||||
|
||||
|
||||
class PathodError(Exception): pass
|
||||
|
||||
|
||||
@ -39,10 +40,10 @@ class SSLOptions:
|
||||
return self.certstore.get_cert(name, [])
|
||||
|
||||
|
||||
|
||||
class PathodHandler(tcp.BaseHandler):
|
||||
wbufsize = 0
|
||||
sni = None
|
||||
|
||||
def info(self, s):
|
||||
logger.info("%s:%s: %s" % (self.address.host, self.address.port, str(s)))
|
||||
|
||||
@ -150,7 +151,8 @@ class PathodHandler(tcp.BaseHandler):
|
||||
|
||||
try:
|
||||
content = http.read_http_body(
|
||||
self.rfile, headers, None, True
|
||||
self.rfile, headers, None,
|
||||
method, None, True
|
||||
)
|
||||
except http.HttpError, s:
|
||||
s = str(s)
|
||||
@ -248,6 +250,7 @@ class PathodHandler(tcp.BaseHandler):
|
||||
|
||||
class Pathod(tcp.TCPServer):
|
||||
LOGBUF = 500
|
||||
|
||||
def __init__(
|
||||
self, addr, confdir=CONFDIR, ssl=False, ssloptions=None,
|
||||
craftanchor="/p/", staticdir=None, anchors=None,
|
||||
|
Loading…
Reference in New Issue
Block a user