aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2014-01-19 12:43:58 +1300
committerAldo Cortesi <aldo@nullcube.com>2014-01-19 12:43:58 +1300
commitf5f46bf0808a5c7d5f9ed89d02a4714bcb66bf43 (patch)
tree673a2d378dba3636732c353840b0019b7c11716a /libmproxy/console
parent069aca1df4223416bc76883c37078e9f2deef28f (diff)
downloadmitmproxy-f5f46bf0808a5c7d5f9ed89d02a4714bcb66bf43.tar.gz
mitmproxy-f5f46bf0808a5c7d5f9ed89d02a4714bcb66bf43.tar.bz2
mitmproxy-f5f46bf0808a5c7d5f9ed89d02a4714bcb66bf43.zip
Re-enable caching on search.
Diffstat (limited to 'libmproxy/console')
-rw-r--r--libmproxy/console/flowview.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/libmproxy/console/flowview.py b/libmproxy/console/flowview.py
index 35fc1e43..45d57721 100644
--- a/libmproxy/console/flowview.py
+++ b/libmproxy/console/flowview.py
@@ -1,4 +1,4 @@
-import os, sys
+import os, sys, copy
import urwid
import common, grideditor, contentview
from .. import utils, flow, controller
@@ -87,9 +87,7 @@ class FlowViewHeader(common.WWrap):
class CallbackCache:
- #commented decorator because it was breaking search functionality (caching after
- # searches.) If it can be made to only cache the first time, it'd be great.
- #@utils.LRUCache(200)
+ @utils.LRUCache(200)
def _callback(self, method, *args, **kwargs):
return getattr(self.obj, method)(*args, **kwargs)
@@ -137,7 +135,6 @@ class FlowView(common.WWrap):
limit = sys.maxint
else:
limit = contentview.VIEW_CUTOFF
-
description, text_objects = cache.callback(
self, "_cached_content_view",
viewmode,
@@ -145,7 +142,6 @@ class FlowView(common.WWrap):
conn.content,
limit
)
-
return (description, text_objects)
def cont_view_handle_missing(self, conn, viewmode):
@@ -173,14 +169,12 @@ class FlowView(common.WWrap):
key = "header",
val = "text"
)
-
if conn.content is not None:
override = self.override_get()
viewmode = self.viewmode_get(override)
msg, body = self.cont_view_handle_missing(conn, viewmode)
elif conn.content == flow.CONTENT_MISSING:
pass
-
return headers, msg, body
def conn_text_merge(self, headers, msg, body):
@@ -188,7 +182,6 @@ class FlowView(common.WWrap):
Grabs what is returned by conn_text_raw and merges them all
toghether, mainly used by conn_text and search
"""
-
override = self.override_get()
viewmode = self.viewmode_get(override)
@@ -222,7 +215,6 @@ class FlowView(common.WWrap):
"""
headers, msg, body = self.conn_text_raw(conn)
merged = self.conn_text_merge(headers, msg, body)
-
return urwid.ListBox(merged)
def _tab(self, content, attr):
@@ -350,6 +342,7 @@ class FlowView(common.WWrap):
i = start_line
found = False
+ text_objects = copy.deepcopy(text_objects)
for text_object in text_objects[start_line:]:
if i != start_line:
start_index = 0