]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix setting watcher for a session
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 21 Apr 2017 12:49:43 +0000 (13:49 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 21 Apr 2017 12:49:43 +0000 (13:49 +0100)
src/libserver/events.c

index 6021f0a395d608b9aae95821e9de89579cb774e8..d9030c5b3b53e2bedb99606f22d7365f0c197cef 100644 (file)
@@ -305,7 +305,6 @@ rspamd_session_watch_start (struct rspamd_async_session *session,
        if (session->cur_watcher == NULL) {
                session->cur_watcher = rspamd_mempool_alloc0 (session->pool,
                                sizeof (*session->cur_watcher));
-               session->flags |= RSPAMD_SESSION_FLAG_WATCHING;
        }
 
        st_elt = rspamd_mempool_alloc (session->pool, sizeof (*st_elt));
@@ -314,6 +313,7 @@ rspamd_session_watch_start (struct rspamd_async_session *session,
        LL_PREPEND (session->cur_watcher->st, st_elt);
 
        session->cur_watcher->id = id;
+       session->flags |= RSPAMD_SESSION_FLAG_WATCHING;
 }
 
 guint