From ed38d3e98fd668c293fd971d9e53bfbcaca1a485 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 8 Nov 2011 14:11:25 +0100 Subject: [PATCH] Check number of logical records when firing watches This is to ensure we don't fire watches prematurely.. Say that first search/present response includes NO records that make it through filtering. --- src/client.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/client.c b/src/client.c index d205bef..ac2e01b 100644 --- a/src/client.c +++ b/src/client.c @@ -555,12 +555,15 @@ void client_got_records(struct client *cl) struct session *se = cl->session; if (se) { - client_unlock(cl); - session_alert_watch(se, SESSION_WATCH_SHOW); - session_alert_watch(se, SESSION_WATCH_BYTARGET); - session_alert_watch(se, SESSION_WATCH_TERMLIST); - session_alert_watch(se, SESSION_WATCH_RECORD); - client_lock(cl); + if (reclist_get_num_records(se->reclist) > 0) + { + client_unlock(cl); + session_alert_watch(se, SESSION_WATCH_SHOW); + session_alert_watch(se, SESSION_WATCH_BYTARGET); + session_alert_watch(se, SESSION_WATCH_TERMLIST); + session_alert_watch(se, SESSION_WATCH_RECORD); + client_lock(cl); + } } } -- 1.7.10.4