]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix issues with empty updates
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Jan 2017 15:18:54 +0000 (15:18 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Jan 2017 15:18:54 +0000 (15:18 +0000)
src/libserver/fuzzy_backend.c
src/libserver/fuzzy_backend_redis.c

index 5ab6739593c2cc0a10a177c43de49eee5116276e..f9b46c16759f583a85216e0af15aaa0836ba607f 100644 (file)
@@ -332,7 +332,7 @@ rspamd_fuzzy_backend_process_updates (struct rspamd_fuzzy_backend *bk,
        g_assert (bk != NULL);
        g_assert (updates != NULL);
 
-       if (g_queue_get_length (updates) > 0) {
+       if (updates) {
                bk->subr->update (bk, updates, src, cb, ud, bk->subr_ud);
        }
        else if (cb) {
index f6ca121303e6f7fe348f718292dcff4eec5a1769..9a6648d4d7443bb0d2a1f8d5617c42f081a30668 100644 (file)
@@ -1095,6 +1095,9 @@ rspamd_fuzzy_update_append_command (struct rspamd_fuzzy_backend *bk,
                        return FALSE;
                }
        }
+       else {
+               g_assert_not_reached ();
+       }
 
        if (io_cmd->is_shingle) {
                if (cmd->cmd == FUZZY_WRITE) {
@@ -1165,6 +1168,9 @@ rspamd_fuzzy_update_append_command (struct rspamd_fuzzy_backend *bk,
                                }
                        }
                }
+               else {
+                       g_assert_not_reached ();
+               }
        }
 
        *shift = cur_shift;