From 9985cf547305ccebc99de4d0b2bb86d3be26947e Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 1 Jul 2012 09:37:03 +1200 Subject: [PATCH] Flush after terminal output. Makes behaviour on the shell less mysterious. --- libmproxy/dump.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libmproxy/dump.py b/libmproxy/dump.py index ea4ac0b3e..a58405eda 100644 --- a/libmproxy/dump.py +++ b/libmproxy/dump.py @@ -143,6 +143,7 @@ class DumpMaster(flow.FlowMaster): def add_event(self, e, level="info"): if self.eventlog: print >> self.outfile, e + self.outfile.flush() def handle_log(self, l): self.add_event(l.msg) @@ -200,6 +201,8 @@ class DumpMaster(flow.FlowMaster): print >> self.outfile print >> self.outfile, result print >> self.outfile, "\n" + if self.o.verbosity: + self.outfile.flush() self.state.delete_flow(f) if self.o.wfile: