MCPcopy
hub / github.com/mitmproxy/mitmproxy / _merge_sends

Function _merge_sends

test/mitmproxy/proxy/tutils.py:81–98  ·  view source on GitHub ↗
(
    lst: list[commands.Command], ignore_hooks: bool, ignore_logs: bool
)

Source from the content-addressed store, hash-verified

79
80
81def _merge_sends(
82 lst: list[commands.Command], ignore_hooks: bool, ignore_logs: bool
83) -> PlaybookEntryList:
84 current_send = None
85 for x in lst:
86 if isinstance(x, commands.SendData):
87 if current_send is None or current_send.connection != x.connection:
88 current_send = x
89 yield x
90 else:
91 current_send.data += x.data
92 else:
93 ignore = (ignore_hooks and isinstance(x, commands.StartHook)) or (
94 ignore_logs and isinstance(x, commands.Log)
95 )
96 if not ignore:
97 current_send = None
98 yield x
99
100
101class _TracebackInPlaybook(commands.Command):

Callers 1

__bool__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…