diff --git a/CHANGELOG.md b/CHANGELOG.md index 71df2eea2..f1a957882 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ ## Unreleased: mitmproxy next +- Flush flow file after each flow to allow further processing. + ([#7967](https://github.com/mitmproxy/mitmproxy/pull/7967), @caiquejjx) - infer_content_encoding: Fallback to UTF-8 for more content types ([#7961](https://github.com/mitmproxy/mitmproxy/pull/7961), @xu-cheng) - Remove `bless` from hex editors to avoid issues with macOS diff --git a/mitmproxy/io/io.py b/mitmproxy/io/io.py index 579bd9e96..af89577d9 100644 --- a/mitmproxy/io/io.py +++ b/mitmproxy/io/io.py @@ -82,7 +82,7 @@ class FlowReader: class FilteredFlowWriter: - def __init__(self, fo, flt): + def __init__(self, fo: BinaryIO, flt: flowfilter.TFilter | None): self.fo = fo self.flt = flt @@ -91,6 +91,7 @@ class FilteredFlowWriter: return d = f.get_state() tnetstring.dump(d, self.fo) + self.fo.flush() def read_flows_from_paths(paths) -> list[flow.Flow]: