mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-29 19:08:44 +00:00
Don't leave dangling browser connections for pipelined requests.
This commit is contained in:
parent
0dd1aa7cc7
commit
8a9f20b78c
@ -20,6 +20,8 @@ class DumpMaster(flow.FlowMaster):
|
|||||||
|
|
||||||
def handle_response(self, msg):
|
def handle_response(self, msg):
|
||||||
f = flow.FlowMaster.handle_response(self, msg)
|
f = flow.FlowMaster.handle_response(self, msg)
|
||||||
|
if not f:
|
||||||
|
return
|
||||||
if 0 < self.verbosity < 3:
|
if 0 < self.verbosity < 3:
|
||||||
print >> self.outfile, ">>",
|
print >> self.outfile, ">>",
|
||||||
print >> self.outfile, msg.request.short()
|
print >> self.outfile, msg.request.short()
|
||||||
@ -41,6 +43,8 @@ class DumpMaster(flow.FlowMaster):
|
|||||||
print >> self.outfile, "\t", i
|
print >> self.outfile, "\t", i
|
||||||
print >> self.outfile, "<<"
|
print >> self.outfile, "<<"
|
||||||
msg.ack()
|
msg.ack()
|
||||||
|
self.state.delete_flow(f)
|
||||||
|
print [i.get_state() for i in self.state.flow_list]
|
||||||
|
|
||||||
|
|
||||||
# begin nocover
|
# begin nocover
|
||||||
|
@ -183,7 +183,8 @@ class State:
|
|||||||
"""
|
"""
|
||||||
f = self.flow_map.get(req.client_conn)
|
f = self.flow_map.get(req.client_conn)
|
||||||
if not f:
|
if not f:
|
||||||
return False
|
f = Flow(req.client_conn)
|
||||||
|
self.add_browserconnect(f)
|
||||||
f.request = req
|
f.request = req
|
||||||
return f
|
return f
|
||||||
|
|
||||||
|
@ -454,8 +454,8 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
|
|||||||
|
|
||||||
def handle(self):
|
def handle(self):
|
||||||
cc = ClientConnection(self.client_address)
|
cc = ClientConnection(self.client_address)
|
||||||
|
cc.send(self.mqueue)
|
||||||
while not cc.close:
|
while not cc.close:
|
||||||
cc.send(self.mqueue)
|
|
||||||
self.handle_request(cc)
|
self.handle_request(cc)
|
||||||
cc = cc.copy()
|
cc = cc.copy()
|
||||||
self.finish()
|
self.finish()
|
||||||
@ -471,6 +471,7 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
|
|||||||
if request is None:
|
if request is None:
|
||||||
cc.close = True
|
cc.close = True
|
||||||
return
|
return
|
||||||
|
|
||||||
if request.is_response():
|
if request.is_response():
|
||||||
response = request
|
response = request
|
||||||
request = False
|
request = False
|
||||||
|
Loading…
Reference in New Issue
Block a user