]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Increase number of connections merely when we have a session
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 8 Nov 2019 16:04:26 +0000 (16:04 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 8 Nov 2019 16:04:26 +0000 (16:04 +0000)
src/fuzzy_storage.c

index ac6c692d1b22fde760115f505ec1a25dc2aff18b..94bbc64849f21f46251a87420cf93743001ae8cf 100644 (file)
@@ -1189,8 +1189,6 @@ accept_fuzzy_socket (EV_P_ ev_io *w, int revents)
        if (revents == EV_READ) {
 
                for (;;) {
-                       worker->nconns++;
-
                        r = rspamd_inet_address_recvfrom (w->fd,
                                        buf,
                                        sizeof (buf),
@@ -1219,6 +1217,7 @@ accept_fuzzy_socket (EV_P_ ev_io *w, int revents)
                        session->ctx = worker->ctx;
                        session->time = (guint64) time (NULL);
                        session->addr = addr;
+                       worker->nconns++;
 
                        if (rspamd_fuzzy_cmd_from_wire (buf, r, session)) {
                                /* Check shingles count sanity */