Block on zero records also for preferred block
authorDennis Schafroth <dennis@indexdata.com>
Wed, 8 Sep 2010 17:13:49 +0000 (19:13 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Wed, 8 Sep 2010 17:13:49 +0000 (19:13 +0200)
src/http_command.c

index 567037f..37c96fa 100644 (file)
@@ -936,7 +936,7 @@ static void cmd_show(struct http_channel *c)
 
     if (block)
     {
-        if (!strcmp(block, "preferred") && !session_is_preferred_clients_ready(s->psession)) {
+        if (!strcmp(block, "preferred") && !session_is_preferred_clients_ready(s->psession) && reclist_get_num_records(s->psession->reclist) == 0) {
             // if there is already a watch/block. we do not block this one
             if (session_set_watch(s->psession, SESSION_WATCH_SHOW_PREF,
                                   show_records_ready, c, c) != 0)