From 8df4d52d0e5099d45df51c81b799fe76b7b3892b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Thu, 22 Nov 2018 19:28:43 +0200 Subject: [PATCH] Use SO_REUSEPORT for Admin Closes #1726 #1723 #1787 --- lib/ProxySQL_Admin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index b45d93be9..b353cb344 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -3374,7 +3374,11 @@ __end_while_pool: c_split_2(sn, ":" , &add, &port); } +#ifdef SO_REUSEPORT + int s = ( atoi(port) ? listen_on_port(add, atoi(port), 128, true) : listen_on_unix(add, 128)); +#else int s = ( atoi(port) ? listen_on_port(add, atoi(port), 128) : listen_on_unix(add, 128)); +#endif if (s>0) { fds[nfds].fd=s; fds[nfds].events=POLLIN; fds[nfds].revents=0; callback_func[nfds]=0; socket_names[nfds]=strdup(sn); nfds++; } if (add) free(add); if (port) free(port);