1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

server: SO_REUSEPORT: enable with LWS_MAX_SMP > 1

Either explicit option selection, or multiple SMP service threads, should
enable SO_REUSEPORT

https://github.com/warmcat/libwebsockets/issues/2470
This commit is contained in:
Ron Frederick 2021-10-30 06:14:28 +01:00 committed by Andy Green
parent b912958a67
commit 7451ce5cfb

View file

@ -261,7 +261,7 @@ done_list:
n = lws_check_opt(a->vhost->options,
LWS_SERVER_OPTION_ALLOW_LISTEN_SHARE);
#endif
if (n && cx->count_threads > 1)
if (n || cx->count_threads > 1) /* ... also implied by threads > 1 */
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT,
(const void *)&opt, sizeof(opt)) < 0) {
compatible_close(sockfd);