diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-02-05 20:26:47 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-02-05 20:26:47 +0100 |
commit | f26d91cb814436fa5c1290459f5313e6831bd53c (patch) | |
tree | e54d13d395f7746b5b92637dd642645ceb34cd58 /libmproxy/protocol/primitives.py | |
parent | 9a55cd733268ff66c19ff6fead18291ec8342d8c (diff) | |
download | mitmproxy-f26d91cb814436fa5c1290459f5313e6831bd53c.tar.gz mitmproxy-f26d91cb814436fa5c1290459f5313e6831bd53c.tar.bz2 mitmproxy-f26d91cb814436fa5c1290459f5313e6831bd53c.zip |
add skeleton to change destinatin server during intercept, fix all testcases on windows
Diffstat (limited to 'libmproxy/protocol/primitives.py')
-rw-r--r-- | libmproxy/protocol/primitives.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libmproxy/protocol/primitives.py b/libmproxy/protocol/primitives.py index f3fdd245..d1546ddd 100644 --- a/libmproxy/protocol/primitives.py +++ b/libmproxy/protocol/primitives.py @@ -3,7 +3,7 @@ from ..proxy import ServerConnection, ClientConnection import copy -class _BackreferenceMixin(object): +class BackreferenceMixin(object): """ If an attribute from the _backrefattr tuple is set, this mixin sets a reference back on the attribute object. @@ -16,7 +16,7 @@ class _BackreferenceMixin(object): _backrefattr = tuple() def __setattr__(self, key, value): - super(_BackreferenceMixin, self).__setattr__(key, value) + super(BackreferenceMixin, self).__setattr__(key, value) if key in self._backrefattr and value is not None: setattr(value, self._backrefname, self) @@ -61,12 +61,17 @@ class Error(stateobject.SimpleStateObject): return c -class Flow(stateobject.SimpleStateObject, _BackreferenceMixin): +class Flow(stateobject.SimpleStateObject, BackreferenceMixin): def __init__(self, conntype, client_conn, server_conn): self.conntype = conntype self.client_conn = client_conn + """@type: ClientConnection""" self.server_conn = server_conn + """@type: ServerConnection""" + self.error = None + """@type: Error""" + self._backup = None _backrefattr = ("error",) _backrefname = "flow" |