diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-02-03 14:51:32 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-02-03 14:51:32 +1300 |
commit | 2cb7429d38243d95664791d3edd7c4894efd6ee9 (patch) | |
tree | e0f0e43515cb1b15c5a5de403814c54f33c62b09 /libmproxy/proxy.py | |
parent | 7924f0797114dffb6224febc0a533dba8c500c40 (diff) | |
download | mitmproxy-2cb7429d38243d95664791d3edd7c4894efd6ee9.tar.gz mitmproxy-2cb7429d38243d95664791d3edd7c4894efd6ee9.tar.bz2 mitmproxy-2cb7429d38243d95664791d3edd7c4894efd6ee9.zip |
Change "connection" to the less confusing "client_conn" throughout.
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r-- | libmproxy/proxy.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index 5110a71a..66be9525 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -84,8 +84,8 @@ def parse_proxy_request(request): class Request(controller.Msg): FMT = '%s %s HTTP/1.0\r\n%s\r\n%s' - def __init__(self, connection, host, port, scheme, method, path, headers, content, timestamp=None): - self.connection = connection + def __init__(self, client_conn, host, port, scheme, method, path, headers, content, timestamp=None): + self.client_conn = client_conn self.host, self.port, self.scheme = host, port, scheme self.method, self.path, self.headers, self.content = method, path, headers, content self.timestamp = timestamp or time.time() @@ -221,7 +221,7 @@ class Response(controller.Msg): return self.FMT%data -class BrowserConnection(controller.Msg): +class ClientConnection(controller.Msg): def __init__(self, address, port): self.address, self.port = address, port controller.Msg.__init__(self) @@ -231,8 +231,8 @@ class BrowserConnection(controller.Msg): class Error(controller.Msg): - def __init__(self, connection, msg, timestamp=None): - self.connection, self.msg = connection, msg + def __init__(self, client_conn, msg, timestamp=None): + self.client_conn, self.msg = client_conn, msg self.timestamp = timestamp or time.time() controller.Msg.__init__(self) @@ -350,7 +350,7 @@ class ProxyHandler(SocketServer.StreamRequestHandler): def handle(self): server = None - bc = BrowserConnection(*self.client_address) + bc = ClientConnection(*self.client_address) bc.send(self.mqueue) try: request = self.read_request(bc) @@ -376,7 +376,7 @@ class ProxyHandler(SocketServer.StreamRequestHandler): server.terminate() self.finish() - def read_request(self, connection): + def read_request(self, client_conn): request = self.rfile.readline() method, scheme, host, port, path = parse_proxy_request(request) if not host: @@ -412,7 +412,7 @@ class ProxyHandler(SocketServer.StreamRequestHandler): content = self.rfile.read(int(headers["content-length"][0])) else: content = "" - return Request(connection, host, port, scheme, method, path, headers, content) + return Request(client_conn, host, port, scheme, method, path, headers, content) def send_response(self, response): self.wfile.write(response.assemble()) |