mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
r3313: in socket_accept() make the new socket non-blocking unless SOCKET_FLAG_BLOCK is set.
(This used to be commit a2d92aa431e0e9752387eebe741d9e6f376f74d7)
This commit is contained in:
parent
c8c3a56b8b
commit
34cd0662f0
@ -141,6 +141,14 @@ static NTSTATUS ipv4_tcp_accept(struct socket_context *sock, struct socket_conte
|
||||
return map_nt_error_from_unix(errno);
|
||||
}
|
||||
|
||||
if (!(flags & SOCKET_FLAG_BLOCK)) {
|
||||
int ret = set_blocking(new_fd, False);
|
||||
if (ret == -1) {
|
||||
close(new_fd);
|
||||
return map_nt_error_from_unix(errno);
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: we could add a 'accept_check' hook here
|
||||
* which get the black/white lists via socket_set_accept_filter()
|
||||
* or something like that
|
||||
|
@ -136,6 +136,14 @@ static NTSTATUS unixdom_accept(struct socket_context *sock,
|
||||
return unixdom_error(errno);
|
||||
}
|
||||
|
||||
if (!(flags & SOCKET_FLAG_BLOCK)) {
|
||||
int ret = set_blocking(new_fd, False);
|
||||
if (ret == -1) {
|
||||
close(new_fd);
|
||||
return map_nt_error_from_unix(errno);
|
||||
}
|
||||
}
|
||||
|
||||
(*new_sock) = talloc_p(NULL, struct socket_context);
|
||||
if (!(*new_sock)) {
|
||||
close(new_fd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user