diff options
Diffstat (limited to 'libmproxy/flow.py')
-rw-r--r-- | libmproxy/flow.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py index fce4cd91..d4aa1805 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -11,7 +11,7 @@ import requests from netlib import odict, wsgi, tcp import netlib.http from . import controller, protocol, tnetstring, filt, script, version, app -from .protocol import http +from .protocol import http, handle from .proxy.connection import ServerConnection from .proxy.primitives import ProxyError @@ -690,12 +690,7 @@ class FlowMaster(controller.Master): self.run_script_hook("clientdisconnect", r) r.reply() - def handle_serverconnection(self, sc): - # To unify the mitmproxy script API, we call the script hook - # "serverconnect" rather than "serverconnection". As things are handled - # differently in libmproxy (ClientConnect + ClientDisconnect vs - # ServerConnection class), there is no "serverdisonnect" event at the - # moment. + def handle_serverconnect(self, sc): self.run_script_hook("serverconnect", sc) sc.reply() @@ -798,7 +793,7 @@ class FlowReader: v = ".".join(str(i) for i in data["version"]) raise FlowReadError("Incompatible serialized data version: %s"%v) off = self.fo.tell() - yield protocol.handle.protocols[data["conntype"]]["flow"]._from_state(data) + yield handle.protocols[data["conntype"]]["flow"]._from_state(data) except ValueError, v: # Error is due to EOF if self.fo.tell() == off and self.fo.read() == '': @@ -819,7 +814,7 @@ class FilteredFlowWriter: class RequestReplayThread(threading.Thread): - name="RequestReplayThread" + name = "RequestReplayThread" def __init__(self, config, flow, masterq, should_exit): self.config, self.flow, self.channel = config, flow, controller.Channel(masterq, should_exit) |