From d9db1cf5b3f7bb86a5aa0f68dcc9867c708f2158 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 9 Sep 2011 17:31:36 +1200 Subject: [PATCH] Change size limit cmdline flag to -Z, enable size limits for replay. --- libmproxy/cmdline.py | 14 +++++++------- libmproxy/flow.py | 6 +++++- mitmproxy | 1 - 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/libmproxy/cmdline.py b/libmproxy/cmdline.py index e368a30b4..6d1ffa3db 100644 --- a/libmproxy/cmdline.py +++ b/libmproxy/cmdline.py @@ -54,12 +54,6 @@ def common_options(parser): action="store_true", dest="eventlog", help="Show event log." ) - parser.add_option( - "-l", - action="store", dest="body_size_limit", default=None, - help="Byte size limit of HTTP request and response bodies."\ - " Understands k/m/g suffixes, i.e. 3m for 3 megabytes." - ) parser.add_option( "-n", action="store_true", dest="no_server", @@ -120,7 +114,13 @@ def common_options(parser): action="store_true", dest="anticomp", default=False, help="Try to convince servers to send us un-compressed data." ) - + parser.add_option( + "-Z", + action="store", dest="body_size_limit", default=None, + metavar="SIZE", + help="Byte size limit of HTTP request and response bodies."\ + " Understands k/m/g suffixes, i.e. 3m for 3 megabytes." + ) group = optparse.OptionGroup(parser, "Client Replay") group.add_option( "-c", diff --git a/libmproxy/flow.py b/libmproxy/flow.py index e6ead0029..63e6835eb 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -1260,7 +1260,11 @@ class FlowMaster(controller.Master): f.response = None f.error = None self.process_new_request(f) - rt = proxy.RequestReplayThread(f, self.masterq, None) + rt = proxy.RequestReplayThread( + f, + self.masterq, + self.server.config.body_size_limit + ) rt.start() #end nocover diff --git a/mitmproxy b/mitmproxy index 53559b8bd..967e9b8c0 100755 --- a/mitmproxy +++ b/mitmproxy @@ -58,7 +58,6 @@ if __name__ == '__main__': opts.intercept = options.intercept opts.debug = options.debug m = console.ConsoleMaster(server, opts) - m.run()