From ddfba158d4755fade6dc543158653d75029dfe97 Mon Sep 17 00:00:00 2001 From: Kaian Date: Fri, 27 Feb 2015 22:08:32 +0100 Subject: [PATCH] Improve Display filtering performance --- config/sngreprc | 4 ++-- src/option.c | 2 +- src/ui_call_list.c | 26 ++++++++++++++++---------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/config/sngreprc b/config/sngreprc index f1c485d..898ce59 100644 --- a/config/sngreprc +++ b/config/sngreprc @@ -16,8 +16,8 @@ # set syntax.branch on ##----------------------------------------------------------------------------- -## Uncomment to configure packet count capture limit (0: disabled) -# set capture.limit 2000 +## Uncomment to configure packet count capture limit (can't be disabled) +# set capture.limit 100000 ## Default capture keyfile for TLS transport # set capture.keyfile /etc/ssl/key.pem diff --git a/src/option.c b/src/option.c index 38c01ed..2bfc02d 100644 --- a/src/option.c +++ b/src/option.c @@ -91,7 +91,7 @@ init_options() set_option_value("sngrep.savepath", home); // Set default capture options - set_option_value("capture.limit", "10000"); + set_option_value("capture.limit", "100000"); set_option_value("capture.device", "any"); set_option_value("capture.lookup", "off"); diff --git a/src/ui_call_list.c b/src/ui_call_list.c index bb7a4f0..9038fff 100644 --- a/src/ui_call_list.c +++ b/src/ui_call_list.c @@ -792,7 +792,12 @@ call_list_add_column(PANEL *panel, enum sip_attr_id id, const char* attr, const void call_list_filter_update(PANEL *panel) { - // TODO + sip_call_t *call = NULL; + + // Force filter evaluation + while((call = call_get_next(call))) + call->filtered = -1; + // Clear list call_list_clear(panel); } @@ -841,12 +846,13 @@ call_list_get_next(PANEL *panel, sip_call_t *cur) next->filtered = 1; continue; } + // This call doesnt match display + if (!call_list_match_dfilter(panel, next)) { + next->filtered = 1; + continue; + } } - // This call doesnt match display - if (!call_list_match_dfilter(panel, next)) - continue; - return next; } return NULL; @@ -868,12 +874,12 @@ call_list_get_prev(PANEL *panel, sip_call_t *cur) prev->filtered = 1; continue; } + // This call doesnt match display + if (!call_list_match_dfilter(panel, prev)) { + prev->filtered = 1; + continue; + } } - - // This call doesnt match display - if (!call_list_match_dfilter(panel, prev)) - continue; - return prev; } return NULL;