]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix multiple listen configuration
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 Sep 2020 14:33:26 +0000 (15:33 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 16 Sep 2020 14:33:26 +0000 (15:33 +0100)
src/libserver/worker_util.c

index 89ebc10cbd0a8750581643998e83a444e16da338..2d40d057c22856d0c4ad65d95bb5cf787df31850 100644 (file)
@@ -1056,7 +1056,7 @@ rspamd_handle_child_fork (struct rspamd_worker *wrk,
                GList *elt = (GList *)v;
                GList *our = cf->listen_socks;
 
-               if (our != elt) {
+               if (g_list_position (our, elt) == -1) {
                        GList *cur = elt;
 
                        while (cur) {
@@ -1064,7 +1064,10 @@ rspamd_handle_child_fork (struct rspamd_worker *wrk,
                                                (struct rspamd_worker_listen_socket *)cur->data;
 
                                if (ls->fd != -1 && close (ls->fd) == -1) {
-                                       msg_err ("cannot close fd %d: %s", ls->fd, strerror (errno));
+                                       msg_err ("cannot close fd %d (addr = %s): %s",
+                                                       ls->fd,
+                                                       rspamd_inet_address_to_string_pretty (ls->addr),
+                                                       strerror (errno));
                                }
 
                                cur = g_list_next (cur);