From 2736c9c7057d968baa82a89e37641ea5ee45953d Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 11 Nov 2019 18:25:50 +0100 Subject: [PATCH] [sans-io] remove old implementations --- mitmproxy/proxy2/layers/__init__.py | 4 ---- mitmproxy/proxy2/layers/{ => old}/glue.py | 0 mitmproxy/proxy2/layers/old/old_http.py | 2 +- mitmproxy/proxy2/layers/{ => old}/websocket.py | 0 mitmproxy/proxy2/server.py | 3 --- test/mitmproxy/proxy2/layers/test_websocket.py | 2 +- 6 files changed, 2 insertions(+), 9 deletions(-) rename mitmproxy/proxy2/layers/{ => old}/glue.py (100%) rename mitmproxy/proxy2/layers/{ => old}/websocket.py (100%) diff --git a/mitmproxy/proxy2/layers/__init__.py b/mitmproxy/proxy2/layers/__init__.py index d075fbf85..93205d0e3 100644 --- a/mitmproxy/proxy2/layers/__init__.py +++ b/mitmproxy/proxy2/layers/__init__.py @@ -1,15 +1,11 @@ from . import modes -from .glue import GlueLayer from .http.http import HTTPLayer from .tcp import TCPLayer from .tls import ClientTLSLayer, ServerTLSLayer -from .websocket import WebsocketLayer __all__ = [ "modes", - "GlueLayer", "HTTPLayer", "TCPLayer", "ClientTLSLayer", "ServerTLSLayer", - "WebsocketLayer", ] diff --git a/mitmproxy/proxy2/layers/glue.py b/mitmproxy/proxy2/layers/old/glue.py similarity index 100% rename from mitmproxy/proxy2/layers/glue.py rename to mitmproxy/proxy2/layers/old/glue.py diff --git a/mitmproxy/proxy2/layers/old/old_http.py b/mitmproxy/proxy2/layers/old/old_http.py index e495098ee..e61eeecaa 100644 --- a/mitmproxy/proxy2/layers/old/old_http.py +++ b/mitmproxy/proxy2/layers/old/old_http.py @@ -12,7 +12,7 @@ from mitmproxy.proxy.protocol.http import HTTPMode from mitmproxy.proxy2 import events, commands, context from mitmproxy.proxy2.context import Context from mitmproxy.proxy2.layer import Layer, NextLayer -from mitmproxy.proxy2.layers import websocket +from mitmproxy.proxy2.layers.old import websocket from mitmproxy.proxy2.utils import expect diff --git a/mitmproxy/proxy2/layers/websocket.py b/mitmproxy/proxy2/layers/old/websocket.py similarity index 100% rename from mitmproxy/proxy2/layers/websocket.py rename to mitmproxy/proxy2/layers/old/websocket.py diff --git a/mitmproxy/proxy2/server.py b/mitmproxy/proxy2/server.py index 5229d7728..a31c9fec2 100644 --- a/mitmproxy/proxy2/server.py +++ b/mitmproxy/proxy2/server.py @@ -20,7 +20,6 @@ from mitmproxy import http, options as moptions from mitmproxy.proxy.protocol.http import HTTPMode from mitmproxy.proxy2 import commands, events, layer, layers from mitmproxy.proxy2.context import Client, Connection, ConnectionState, Context -from mitmproxy.proxy2.layers import glue from mitmproxy.utils import human @@ -200,8 +199,6 @@ class ConnectionHandler(metaclass=abc.ABCMeta): elif isinstance(command, commands.GetSocket): socket = self.transports[command.connection].w.get_extra_info("socket") self.server_event(events.GetSocketReply(command, socket)) - elif isinstance(command, glue.GlueGetConnectionHandler): - self.server_event(glue.GlueGetConnectionHandlerReply(command, self)) elif isinstance(command, commands.Hook): asyncio.ensure_future( self.handle_hook(command) diff --git a/test/mitmproxy/proxy2/layers/test_websocket.py b/test/mitmproxy/proxy2/layers/test_websocket.py index 6c65b19e9..512efc3ba 100644 --- a/test/mitmproxy/proxy2/layers/test_websocket.py +++ b/test/mitmproxy/proxy2/layers/test_websocket.py @@ -5,7 +5,7 @@ import pytest from mitmproxy.net.websockets import Frame, OPCODE from mitmproxy.proxy2 import commands, events -from mitmproxy.proxy2.layers import websocket +from mitmproxy.proxy2.layers.old import websocket from mitmproxy.test import tflow from .. import tutils