diff --git a/binaries/aarch64/tpws b/binaries/aarch64/tpws index 6ac03ca1..5c828eb3 100755 Binary files a/binaries/aarch64/tpws and b/binaries/aarch64/tpws differ diff --git a/binaries/arm/tpws b/binaries/arm/tpws index 06ddfb38..905a433d 100755 Binary files a/binaries/arm/tpws and b/binaries/arm/tpws differ diff --git a/binaries/freebsd-x64/tpws b/binaries/freebsd-x64/tpws index 0eb5d09f..e64e742c 100755 Binary files a/binaries/freebsd-x64/tpws and b/binaries/freebsd-x64/tpws differ diff --git a/binaries/mac64/tpws b/binaries/mac64/tpws index 21eaeb19..3b67a1d6 100755 Binary files a/binaries/mac64/tpws and b/binaries/mac64/tpws differ diff --git a/binaries/mips32r1-lsb/tpws b/binaries/mips32r1-lsb/tpws index 86a8a7ca..560ac3d4 100755 Binary files a/binaries/mips32r1-lsb/tpws and b/binaries/mips32r1-lsb/tpws differ diff --git a/binaries/mips32r1-msb/tpws b/binaries/mips32r1-msb/tpws index a7e61147..3f0e8011 100755 Binary files a/binaries/mips32r1-msb/tpws and b/binaries/mips32r1-msb/tpws differ diff --git a/binaries/mips64r2-msb/tpws b/binaries/mips64r2-msb/tpws index 620aac6b..8a252254 100755 Binary files a/binaries/mips64r2-msb/tpws and b/binaries/mips64r2-msb/tpws differ diff --git a/binaries/ppc/tpws b/binaries/ppc/tpws index 79b6c1b6..b328c175 100755 Binary files a/binaries/ppc/tpws and b/binaries/ppc/tpws differ diff --git a/binaries/x86/tpws b/binaries/x86/tpws index 6380d3f0..c98e332e 100755 Binary files a/binaries/x86/tpws and b/binaries/x86/tpws differ diff --git a/binaries/x86_64/tpws b/binaries/x86_64/tpws index 2731168b..995751e1 100755 Binary files a/binaries/x86_64/tpws and b/binaries/x86_64/tpws differ diff --git a/binaries/x86_64/tpws_wsl.tgz b/binaries/x86_64/tpws_wsl.tgz index acc89bdb..7a734d49 100644 Binary files a/binaries/x86_64/tpws_wsl.tgz and b/binaries/x86_64/tpws_wsl.tgz differ diff --git a/tpws/tpws_conn.c b/tpws/tpws_conn.c index 28c80203..51df4dd5 100644 --- a/tpws/tpws_conn.c +++ b/tpws/tpws_conn.c @@ -1200,7 +1200,12 @@ int event_loop(const int *listen_fd, size_t listen_fd_ct) accept_salen = sizeof(accept_sa); //Accept new connection +#if defined (__APPLE__) + // macos does not have accept4() tmp_fd = accept(conn->fd, (struct sockaddr*)&accept_sa, &accept_salen); +#else + tmp_fd = accept4(conn->fd, (struct sockaddr*)&accept_sa, &accept_salen, SOCK_NONBLOCK); +#endif if (tmp_fd < 0) { perror("Failed to accept connection"); @@ -1210,12 +1215,14 @@ int event_loop(const int *listen_fd, size_t listen_fd_ct) close(tmp_fd); VPRINT("Too many local legs : %d", legs_local) } +#if defined (__APPLE__) // separate fcntl call to comply with macos else if (fcntl(tmp_fd, F_SETFL, O_NONBLOCK) < 0) { perror("socket set O_NONBLOCK (accept)"); close(tmp_fd); } +#endif else if (!(conn=add_tcp_connection(efd, &conn_list, tmp_fd, (struct sockaddr*)&accept_sa, params.port, params.proxy_type))) { // add_tcp_connection closes fd in case of failure