* fhandler_socket.cc (fhandler_socket::evaluate_events): Handle

connect_state and af_local_connect connect call here, once, independent
	of FD_CONNECT being requested.  Add comment to explain why.
	(fhandler_socket::connect): Drop connect_state handling and calling
	af_local_connect.  Move remaining AF_LOCAL stuff prior  to calling
	::connect and explain why.  Simplify error case.
	* poll.cc (poll): Handle connect state independently of POLLOUT being
	requested for the descriptor to allow setting POLLIN if connect failed.
	Add comment.
	* select.cc (set_bits): Drop connect_state and AF_LOCAL handling here.
This commit is contained in:
Corinna Vinschen
2014-10-11 12:14:29 +00:00
parent 9f64fd8081
commit 2483fa2719
4 changed files with 71 additions and 57 deletions

View File

@@ -480,16 +480,10 @@ set_bits (select_record *me, fd_set *readfds, fd_set *writefds,
UNIX_FD_SET (me->fd, writefds);
if (me->except_on_write && (sock = me->fh->is_socket ()))
{
/* Special AF_LOCAL handling. */
if (!me->read_ready && sock->connect_state () == connect_pending
&& sock->af_local_connect ())
{
if (me->read_selected)
UNIX_FD_SET (me->fd, readfds);
sock->connect_state (connect_failed);
}
else
sock->connect_state (connected);
/* Set readfds entry in case of a failed connect. */
if (!me->read_ready && me->read_selected
&& sock->connect_state () == connect_failed)
UNIX_FD_SET (me->fd, readfds);
}
ready++;
}