commit 4241a6d: [Minor] Fix the previous commit (sync main and children)

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Sep 11 16:49:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-09-11 17:44:55 +0100
URL: https://github.com/rspamd/rspamd/commit/4241a6d65d2ffa7f18763129472a94666fb55d1c (HEAD -> master)

[Minor] Fix the previous commit (sync main and children)

---
 src/libserver/worker_util.c | 3 +--
 src/rspamd.h                | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 417cbc733..89ebc10cb 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -970,7 +970,6 @@ rspamd_maybe_reuseport_socket (struct rspamd_worker_listen_socket *ls)
 			if (ls->fd != -1) {
 				close (ls->fd);
 			}
-			ls->reuseport = true;
 			ls->fd = nfd;
 			nfd = -1;
 		}
@@ -1172,7 +1171,7 @@ rspamd_handle_main_fork (struct rspamd_worker *wrk,
 		struct rspamd_worker_listen_socket *ls =
 				(struct rspamd_worker_listen_socket *)cur->data;
 
-		if (ls->reuseport) {
+		if (ls->fd != -1 && ls->type == RSPAMD_WORKER_SOCKET_UDP) {
 			close (ls->fd);
 			ls->fd = -1;
 		}
diff --git a/src/rspamd.h b/src/rspamd.h
index 470d13085..2dfb512bc 100644
--- a/src/rspamd.h
+++ b/src/rspamd.h
@@ -236,7 +236,6 @@ struct rspamd_worker_listen_socket {
 	gint fd;
 	enum rspamd_worker_socket_type type;
 	bool is_systemd;
-	bool reuseport;
 };
 
 typedef struct worker_s {


More information about the Commits mailing list