From ab0e10e60f9d481ac0aa782c69bd02de9b7fbf0d Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 3 Apr 2012 22:37:24 +1200 Subject: Serialize requestcount for ClientConnect objects. --- libmproxy/flow.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'libmproxy/flow.py') diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 76a8a1c7..6444fb7e 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -324,7 +324,7 @@ class Request(HTTPMsg): Exposes the following attributes: - client_conn: ClientConnection object, or None if this is a replay. + client_conn: ClientConnect object, or None if this is a replay. headers: ODictCaseless object content: Content of the request, or None @@ -760,15 +760,20 @@ class ClientConnect(controller.Msg): return self._get_state() == other._get_state() def _load_state(self, state): - self.address = state + self.requestcount = state["requestcount"] def _get_state(self): - return list(self.address) if self.address else None + return dict( + address = list(self.address), + requestcount = self.requestcount, + ) @classmethod def _from_state(klass, state): if state: - return klass(state) + k = klass(state["address"]) + k._load_state(state) + return k else: return None -- cgit v1.2.3