Don't leave dangling browser connections for pipelined requests.

This commit is contained in:
Aldo Cortesi 2011-02-16 22:37:04 +13:00
parent 0dd1aa7cc7
commit 8a9f20b78c
3 changed files with 8 additions and 2 deletions

View File

@ -20,6 +20,8 @@ class DumpMaster(flow.FlowMaster):
def handle_response(self, msg):
f = flow.FlowMaster.handle_response(self, msg)
if not f:
return
if 0 < self.verbosity < 3:
print >> self.outfile, ">>",
print >> self.outfile, msg.request.short()
@ -41,6 +43,8 @@ class DumpMaster(flow.FlowMaster):
print >> self.outfile, "\t", i
print >> self.outfile, "<<"
msg.ack()
self.state.delete_flow(f)
print [i.get_state() for i in self.state.flow_list]
# begin nocover

View File

@ -183,7 +183,8 @@ class State:
"""
f = self.flow_map.get(req.client_conn)
if not f:
return False
f = Flow(req.client_conn)
self.add_browserconnect(f)
f.request = req
return f

View File

@ -454,8 +454,8 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
def handle(self):
cc = ClientConnection(self.client_address)
while not cc.close:
cc.send(self.mqueue)
while not cc.close:
self.handle_request(cc)
cc = cc.copy()
self.finish()
@ -471,6 +471,7 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
if request is None:
cc.close = True
return
if request.is_response():
response = request
request = False