aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2016-01-30 22:05:23 +0100
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-02-04 09:52:28 +0100
commitf2097b47ce6c88e2bef0889fb7e7d52b63158082 (patch)
tree2e9be58ec7f799bb59dcc07fa4745d4efdb5a7f7
parent6d3b3994e27b3cd97c74612bc64c7e0457aeb448 (diff)
downloadmitmproxy-f2097b47ce6c88e2bef0889fb7e7d52b63158082.tar.gz
mitmproxy-f2097b47ce6c88e2bef0889fb7e7d52b63158082.tar.bz2
mitmproxy-f2097b47ce6c88e2bef0889fb7e7d52b63158082.zip
fix race condition during state loading
PyPy and Python2.7 might process the state attributes in different order.
-rw-r--r--libmproxy/models/http.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmproxy/models/http.py b/libmproxy/models/http.py
index 3914440e..a52597b4 100644
--- a/libmproxy/models/http.py
+++ b/libmproxy/models/http.py
@@ -11,9 +11,10 @@ from netlib.tcp import Address
from .. import version, stateobject
from .flow import Flow
+from collections import OrderedDict
class MessageMixin(stateobject.StateObject):
- _stateobject_attributes = dict(
+ _stateobject_attributes = OrderedDict(
http_version=bytes,
headers=Headers,
timestamp_start=float,