From 34b88e111ab3febcd5d9fa510f6b8658185e95a2 Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Thu, 21 Oct 2021 18:08:50 +0200 Subject: [PATCH] remove debug changes to python scripts --- src/test/regress/mitmscripts/fluent.py | 21 --------------------- src/test/regress/mitmscripts/structs.py | 1 - 2 files changed, 22 deletions(-) diff --git a/src/test/regress/mitmscripts/fluent.py b/src/test/regress/mitmscripts/fluent.py index e7a929ad5..0039676d5 100644 --- a/src/test/regress/mitmscripts/fluent.py +++ b/src/test/regress/mitmscripts/fluent.py @@ -142,8 +142,6 @@ class KillHandler(Handler): def __init__(self, root): super().__init__(root) def _handle(self, flow, message): - logging.debug("kill flow: %s", type(flow).__name__) - logging.debug("killable: %s", str(flow.killable)) flow.kill() return 'done' @@ -242,18 +240,13 @@ class OnPacket(Handler, ActionsMixin, FilterableMixin): self.packet_kind = packet_kind self.filters = kwargs def _handle(self, flow, message): - logging.debug("handler for %s", self.packet_kind) - if not message.parsed: # if this is the first message in the connection we just skip it return 'done' for msg in message.parsed: typ = structs.message_type(msg, from_frontend=message.from_client) - logging.debug("%s == %s (%s)", typ, self.packet_kind, str(typ == self.packet_kind)) if typ == self.packet_kind: - logging.debug("msg: %s", msg) matches = structs.message_matches(msg, self.filters, message.from_client) - logging.debug("did we match: %s", str(matches)) if matches: return 'pass' return 'done' @@ -433,18 +426,6 @@ def configure(updated): create_thread(fifoname) -# def next_layer(layer): -# ''' -# mitmproxy wasn't really meant for intercepting raw tcp streams, it tries to wrap the -# upsteam connection (the one to the worker) in a tls stream. This hook intercepts the -# part where it creates the TlsLayer (it happens in root_context.py) and instead creates -# a RawTCPLayer. That's the layer which calls our tcp_message hook -# ''' -# if isinstance(layer, ClientTLSLayer) or isinstance(layer, ServerTLSLayer): -# replacement = TCPLayer(layer.ctx) -# layer.reply.send(replacement) - - def tcp_message(flow: tcp.TCPFlow): ''' This callback is hit every time mitmproxy receives a packet. It's the main entrypoint @@ -452,8 +433,6 @@ def tcp_message(flow: tcp.TCPFlow): ''' global connection_count - logging.info("tcp_message: %s, %s", type(flow).__name__, str(flow.live)) - tcp_msg = flow.messages[-1] # Keep track of all the different connections, assign a unique id to each diff --git a/src/test/regress/mitmscripts/structs.py b/src/test/regress/mitmscripts/structs.py index 4a13eb107..a6333a3fa 100644 --- a/src/test/regress/mitmscripts/structs.py +++ b/src/test/regress/mitmscripts/structs.py @@ -7,7 +7,6 @@ from construct import ( import construct.lib as cl import re -import logging # For all possible message formats see: # https://www.postgresql.org/docs/current/protocol-message-formats.html