diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-09-06 13:09:57 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-09-06 13:09:57 +0200 |
commit | 3c65510ef54c5773c22cd439488ae21dac95ee74 (patch) | |
tree | 891bebd302cbce96814556211e935b0e2a2abd9d /libmproxy/proxy | |
parent | 3a8f6488074ed7adf596637b77356553ccfca575 (diff) | |
download | mitmproxy-3c65510ef54c5773c22cd439488ae21dac95ee74.tar.gz mitmproxy-3c65510ef54c5773c22cd439488ae21dac95ee74.tar.bz2 mitmproxy-3c65510ef54c5773c22cd439488ae21dac95ee74.zip |
coverage++
Diffstat (limited to 'libmproxy/proxy')
-rw-r--r-- | libmproxy/proxy/server.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libmproxy/proxy/server.py b/libmproxy/proxy/server.py index 092eae54..d647ea9d 100644 --- a/libmproxy/proxy/server.py +++ b/libmproxy/proxy/server.py @@ -69,9 +69,9 @@ class ConnectionHandler: self.sni = None def handle(self): - self.log("clientconnect", "info") - try: + self.log("clientconnect", "info") + # Can we already identify the target server and connect to it? client_ssl, server_ssl = False, False if self.config.get_upstream_server: @@ -95,6 +95,10 @@ class ConnectionHandler: # Delegate handling to the protocol handler protocol_handler(self.conntype)(self).handle_messages() + self.del_server_connection() + self.log("clientdisconnect", "info") + self.channel.tell("clientdisconnect", self) + except ProxyError as e: protocol_handler(self.conntype)(self).handle_error(e) except Exception: @@ -105,10 +109,6 @@ class ConnectionHandler: print >> sys.stderr, "mitmproxy has crashed!" print >> sys.stderr, "Please lodge a bug report at: https://github.com/mitmproxy/mitmproxy" - self.del_server_connection() - self.log("clientdisconnect", "info") - self.channel.tell("clientdisconnect", self) - def del_server_connection(self): """ Deletes (and closes) an existing server connection. |