mirror of https://github.com/citusdata/citus.git
remove debug changes to python scripts
parent
fb38a4c284
commit
34b88e111a
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue