diff options
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/console/contentview.py | 7 | ||||
-rw-r--r-- | libmproxy/console/flowview.py | 9 | ||||
-rw-r--r-- | libmproxy/protocol/tcp.py | 4 |
3 files changed, 13 insertions, 7 deletions
diff --git a/libmproxy/console/contentview.py b/libmproxy/console/contentview.py index b1b99bb6..582723bb 100644 --- a/libmproxy/console/contentview.py +++ b/libmproxy/console/contentview.py @@ -488,12 +488,15 @@ def get(name): return i -def get_content_view(viewmode, hdrItems, content, limit, logfunc): +def get_content_view(viewmode, hdrItems, content, limit, logfunc, is_request): """ Returns a (msg, body) tuple. """ if not content: - return ("No content", "") + if is_request: + return "No request content (press tab to view response)", "" + else: + return "No content", "" msg = [] hdrs = flow.ODictCaseless([list(i) for i in hdrItems]) diff --git a/libmproxy/console/flowview.py b/libmproxy/console/flowview.py index c01bb08f..f95cd776 100644 --- a/libmproxy/console/flowview.py +++ b/libmproxy/console/flowview.py @@ -3,7 +3,7 @@ import os, sys, copy import urwid from . import common, grideditor, contentview from .. import utils, flow, controller -from ..protocol.http import HTTPResponse, CONTENT_MISSING, decoded +from ..protocol.http import HTTPRequest, HTTPResponse, CONTENT_MISSING, decoded class SearchError(Exception): pass @@ -131,8 +131,8 @@ class FlowView(common.WWrap): else: self.view_request() - def _cached_content_view(self, viewmode, hdrItems, content, limit): - return contentview.get_content_view(viewmode, hdrItems, content, limit, self.master.add_event) + def _cached_content_view(self, viewmode, hdrItems, content, limit, is_request): + return contentview.get_content_view(viewmode, hdrItems, content, limit, self.master.add_event, is_request) def content_view(self, viewmode, conn): full = self.state.get_flow_setting( @@ -149,7 +149,8 @@ class FlowView(common.WWrap): viewmode, tuple(tuple(i) for i in conn.headers.lst), conn.content, - limit + limit, + isinstance(conn, HTTPRequest) ) return (description, text_objects) diff --git a/libmproxy/protocol/tcp.py b/libmproxy/protocol/tcp.py index d2d21829..5314b577 100644 --- a/libmproxy/protocol/tcp.py +++ b/libmproxy/protocol/tcp.py @@ -56,7 +56,9 @@ class TCPHandler(ProtocolHandler): conns.remove(src.rfile) # Shutdown connection to the other peer if dst.ssl_established: - dst.connection.shutdown() + # We can't half-close a connection, so we just close everything here. + # Sockets will be cleaned up on a higher level. + return else: dst.connection.shutdown(socket.SHUT_WR) |