aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol/primitives.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/protocol/primitives.py')
-rw-r--r--libmproxy/protocol/primitives.py23
1 files changed, 1 insertions, 22 deletions
diff --git a/libmproxy/protocol/primitives.py b/libmproxy/protocol/primitives.py
index a227d904..a84b4061 100644
--- a/libmproxy/protocol/primitives.py
+++ b/libmproxy/protocol/primitives.py
@@ -9,24 +9,6 @@ from ..proxy.connection import ClientConnection, ServerConnection
KILL = 0 # const for killed requests
-class BackreferenceMixin(object):
- """
- If an attribute from the _backrefattr tuple is set,
- this mixin sets a reference back on the attribute object.
- Example:
- e = Error()
- f = Flow()
- f.error = e
- assert f is e.flow
- """
- _backrefattr = tuple()
-
- def __setattr__(self, key, value):
- super(BackreferenceMixin, self).__setattr__(key, value)
- if key in self._backrefattr and value is not None:
- setattr(value, self._backrefname, self)
-
-
class Error(stateobject.SimpleStateObject):
"""
An Error.
@@ -70,7 +52,7 @@ class Error(stateobject.SimpleStateObject):
return c
-class Flow(stateobject.SimpleStateObject, BackreferenceMixin):
+class Flow(stateobject.SimpleStateObject):
def __init__(self, conntype, client_conn, server_conn, live=None):
self.conntype = conntype
self.client_conn = client_conn
@@ -84,9 +66,6 @@ class Flow(stateobject.SimpleStateObject, BackreferenceMixin):
"""@type: Error"""
self._backup = None
- _backrefattr = ("error",)
- _backrefname = "flow"
-
_stateobject_attributes = dict(
error=Error,
client_conn=ClientConnection,