Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: replay.py

Issue 153503002: Make traffic shaping work when WPR chooses the server ports. (Closed) Base URL: http://web-page-replay.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dnsproxy.py ('k') | servermanager.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: replay.py
===================================================================
--- replay.py (revision 539)
+++ replay.py (working copy)
@@ -151,15 +151,10 @@
def AddTrafficShaper(server_manager, options, host):
if options.shaping_dummynet:
- ssl_port = options.ssl_shaping_port if options.ssl else None
- kwargs = dict(
- host=host, port=options.shaping_port, ssl_port=ssl_port,
- dns_port=options.dns_shaping_port,
+ server_manager.AppendTrafficShaper(
+ trafficshaper.TrafficShaper, host=host,
use_loopback=not options.server_mode and host == '127.0.0.1',
**options.shaping_dummynet)
- if not options.dns_forwarding:
- kwargs['dns_port'] = None
- server_manager.Append(trafficshaper.TrafficShaper, **kwargs)
class OptionsWrapper(object):
@@ -250,12 +245,6 @@
self._options.down, self._options.up, self._options.delay_ms = \
net_configs.GetNetConfig(self.net)
self._nondefaults.update(['down', 'up', 'delay_ms'])
- if not self.shaping_port:
- self._options.shaping_port = self.port
- if not self.ssl_shaping_port:
- self._options.ssl_shaping_port = self.ssl_port
- if not self.dns_shaping_port:
- self._options.dns_shaping_port = self.dns_port
if not self.ssl:
self._options.certfile = None
self.shaping_dns = self._ShapingKeywordArgs('dns')
@@ -514,21 +503,6 @@
action='store',
type='int',
help='DNS port number to listen on.')
- harness_group.add_option('--shaping_port', default=None,
- action='store',
- type='int',
- help='Port on which to apply traffic shaping. Defaults to the '
- 'listen port (--port)')
- harness_group.add_option('--ssl_shaping_port', default=None,
- action='store',
- type='int',
- help='SSL port on which to apply traffic shaping. Defaults to the '
- 'SSL listen port (--ssl_port)')
- harness_group.add_option('--dns_shaping_port', default=None,
- action='store',
- type='int',
- help='DNS port on which to apply traffic shaping. Defaults to the '
- 'DNS listen port (--dns_port)')
harness_group.add_option('-c', '--certfile', default=None,
action='store',
type='string',
« no previous file with comments | « dnsproxy.py ('k') | servermanager.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698