diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-08-02 14:56:09 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-08-02 14:56:09 +1200 |
commit | f3742f29daea1f8dc47d0afaf643161548e0ef85 (patch) | |
tree | f97b0eedab0d6e3b2fc797b850f8716c755d9174 | |
parent | f3f8462ddc7cc6cd4f708538457091d079eb9ff2 (diff) | |
download | mitmproxy-f3742f29daea1f8dc47d0afaf643161548e0ef85.tar.gz mitmproxy-f3742f29daea1f8dc47d0afaf643161548e0ef85.tar.bz2 mitmproxy-f3742f29daea1f8dc47d0afaf643161548e0ef85.zip |
We no longer need to track clientconnections.
-rw-r--r-- | libmproxy/flow.py | 13 | ||||
-rw-r--r-- | test/test_flow.py | 7 |
2 files changed, 0 insertions, 20 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py index bbdd21a6..def52caa 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -336,8 +336,6 @@ class Flow: class State: def __init__(self): - self.client_connections = [] - self._flow_map = {} self._flow_list = [] self.view = [] @@ -361,15 +359,6 @@ class State: c += 1 return c - def clientconnect(self, cc): - self.client_connections.append(cc) - - def clientdisconnect(self, dc): - """ - Start a browser connection. - """ - self.client_connections.remove(dc.client_conn) - def add_request(self, req): """ Add a request to the state. Returns the matching flow. @@ -634,11 +623,9 @@ class FlowMaster(controller.Master): #end nocover def handle_clientconnect(self, r): - self.state.clientconnect(r) r.ack() def handle_clientdisconnect(self, r): - self.state.clientdisconnect(r) r.ack() def handle_error(self, r): diff --git a/test/test_flow.py b/test/test_flow.py index 59c4e5b4..b87951b6 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -253,8 +253,6 @@ class uState(libpry.AutoTree): """ bc = proxy.ClientConnect(("address", 22)) c = flow.State() - c.clientconnect(bc) - assert len(c.client_connections) == 1 req = tutils.treq(bc) f = c.add_request(req) @@ -284,8 +282,6 @@ class uState(libpry.AutoTree): assert c.active_flow_count() == 0 dc = proxy.ClientDisconnect(bc) - c.clientdisconnect(dc) - assert not c.client_connections def test_err(self): bc = proxy.ClientConnect(("address", 22)) @@ -302,7 +298,6 @@ class uState(libpry.AutoTree): c = flow.State() req = tutils.treq() - c.clientconnect(req.client_conn) assert len(c.view) == 0 f = c.add_request(req) @@ -317,7 +312,6 @@ class uState(libpry.AutoTree): assert len(c.view) == 1 req = tutils.treq() - c.clientconnect(req.client_conn) c.add_request(req) assert len(c.view) == 2 c.set_limit("~q") @@ -453,7 +447,6 @@ class uFlowMaster(libpry.AutoTree): assert not fm.handle_response(rx) dc = proxy.ClientDisconnect(req.client_conn) - fm.handle_clientdisconnect(dc) err = proxy.Error(f.request, "msg") fm.handle_error(err) |