mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 02:42:58 +01:00
Merge branch 'zeromq/master'
This commit is contained in:
commit
cbbfa14798
@ -280,6 +280,13 @@ zmq::fd_t zmq::ipc_listener_t::accept ()
|
||||
return retired_fd;
|
||||
}
|
||||
|
||||
// Race condition can cause socket not to be closed (if fork happens
|
||||
// between accept and this point).
|
||||
#ifdef FD_CLOEXEC
|
||||
int rc = fcntl (sock, F_SETFD, FD_CLOEXEC);
|
||||
errno_assert (rc != -1);
|
||||
#endif
|
||||
|
||||
// IPC accept() filters
|
||||
#if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED
|
||||
if (!filter (sock)) {
|
||||
|
@ -309,7 +309,6 @@ int zmq::session_base_t::zap_connect ()
|
||||
zap_pipe->set_nodelay ();
|
||||
zap_pipe->set_event_sink (this);
|
||||
|
||||
new_pipes [1]->set_nodelay ();
|
||||
send_bind (peer.socket, new_pipes [1], false);
|
||||
|
||||
// Send empty identity if required by the peer.
|
||||
|
@ -288,6 +288,13 @@ zmq::fd_t zmq::tcp_listener_t::accept ()
|
||||
}
|
||||
#endif
|
||||
|
||||
// Race condition can cause socket not to be closed (if fork happens
|
||||
// between accept and this point).
|
||||
#ifdef FD_CLOEXEC
|
||||
int rc = fcntl (sock, F_SETFD, FD_CLOEXEC);
|
||||
errno_assert (rc != -1);
|
||||
#endif
|
||||
|
||||
if (!options.tcp_accept_filters.empty ()) {
|
||||
bool matched = false;
|
||||
for (options_t::tcp_accept_filters_t::size_type i = 0; i != options.tcp_accept_filters.size (); ++i) {
|
||||
|
Loading…
Reference in New Issue
Block a user