From 32af66881465ae98a53665c8ddd42c02aaf492f7 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 2 Mar 2014 22:15:53 +1300 Subject: Minor cleanups. --- libmproxy/protocol/__init__.py | 5 +++-- libmproxy/protocol/tcp.py | 13 ++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'libmproxy/protocol') diff --git a/libmproxy/protocol/__init__.py b/libmproxy/protocol/__init__.py index 580d693c..2c2e7285 100644 --- a/libmproxy/protocol/__init__.py +++ b/libmproxy/protocol/__init__.py @@ -35,7 +35,6 @@ class TemporaryServerChangeMixin(object): This mixin allows safe modification of the target server, without any need to expose the ConnectionHandler to the Flow. """ - def change_server(self, address, ssl): if address == self.c.server_conn.address(): return @@ -98,4 +97,6 @@ def handle_messages(conntype, connection_handler): def handle_error(conntype, connection_handler, error): - return _handler(conntype, connection_handler).handle_error(error) \ No newline at end of file + return _handler(conntype, connection_handler).handle_error(error) + + diff --git a/libmproxy/protocol/tcp.py b/libmproxy/protocol/tcp.py index df7e6692..1591eb04 100644 --- a/libmproxy/protocol/tcp.py +++ b/libmproxy/protocol/tcp.py @@ -32,12 +32,11 @@ class TCPHandler(ProtocolHandler): if d == "": # connection closed break data.write(d) - - """ - OpenSSL Connections have an internal buffer that might contain data altough everything is read - from the socket. Thankfully, connection.pending() returns the amount of bytes in this buffer, - so we can read it completely at once. - """ + # OpenSSL Connections have an internal buffer that might + # contain data altough everything is read from the socket. + # Thankfully, connection.pending() returns the amount of + # bytes in this buffer, so we can read it completely at + # once. if src.ssl_established: data.write(rfile.read(src.connection.pending())) else: # no data left, but not closed yet @@ -57,4 +56,4 @@ class TCPHandler(ProtocolHandler): self.c.log("%s %s\r\n%s" % (direction, dst_str,data)) dst.wfile.write(data) - dst.wfile.flush() \ No newline at end of file + dst.wfile.flush() -- cgit v1.2.3