From a979e1ad50f9336badaac48dd1f8ae6247ed0c55 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 25 Mar 2012 11:18:33 +1300 Subject: [PATCH] Re-enable caching for content view calculation. --- libmproxy/console/flowview.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libmproxy/console/flowview.py b/libmproxy/console/flowview.py index 3a6f02d57..080017df0 100644 --- a/libmproxy/console/flowview.py +++ b/libmproxy/console/flowview.py @@ -90,8 +90,13 @@ class FlowViewHeader(common.WWrap): class CallbackCache: @utils.LRUCache(100) + def _callback(self, method, *args, **kwargs): + return getattr(self.obj, method)(*args, **kwargs) + def callback(self, obj, method, *args, **kwargs): - return getattr(obj, method)(*args, **kwargs) + # obj varies! + self.obj = obj + return self._callback(method, *args, **kwargs) cache = CallbackCache()