| 20 | ) |
| 21 | |
| 22 | def keepgoing(self) -> bool: |
| 23 | # Checking for proxyserver.active_connections is important for server replay, |
| 24 | # the addon may report that replay is finished but not the entire response has been sent yet. |
| 25 | # (https://github.com/mitmproxy/mitmproxy/issues/7569) |
| 26 | checks = [ |
| 27 | "readfile.reading", |
| 28 | "replay.client.count", |
| 29 | "replay.server.count", |
| 30 | "proxyserver.active_connections", |
| 31 | ] |
| 32 | return any([ctx.master.commands.call(c) for c in checks]) |
| 33 | |
| 34 | def shutdown(self): # pragma: no cover |
| 35 | ctx.master.shutdown() |