mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-14 02:22:03 +08:00
Set blocking mode to fd returned by accept
That addresses issues in OpenBSD where the fd is set to non blocking when the accept's fd is non blocking.
This commit is contained in:
@@ -1111,6 +1111,10 @@ int main(int argc, char** argv)
|
||||
continue;
|
||||
}
|
||||
set_cloexec_flag (fd, 1);
|
||||
#ifndef __linux__
|
||||
/* OpenBSD sets the non-blocking flag if accept's fd is non-blocking */
|
||||
set_block(fd);
|
||||
#endif
|
||||
|
||||
if (s->config->max_clients > 0 && s->active_clients >= s->config->max_clients) {
|
||||
close(fd);
|
||||
|
||||
Reference in New Issue
Block a user