lib/async_req: make sure we return errors early from async_connect_send/recv
authorStefan Metzmacher <metze@samba.org>
Wed, 2 Oct 2019 14:56:30 +0000 (07:56 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 26 Feb 2020 19:45:36 +0000 (19:45 +0000)
commit048a4230b2774f4dd1ec706af5b675226da1e872
tree61c9463f6d9e4e92d3aebdbc1db4bf49cf716308
parent6d63fa024668d1f02fee0fa6b309497703be6a96
lib/async_req: make sure we return errors early from async_connect_send/recv

While it is true that [e]poll() only needs POLLOUT
and POLLERR/POLLHUP are added implicitly.
For tevent we need TEVENT_FD_READ in order to see POLLERR/POLLHUP.

The socket becomes only readable when we hit an error.
Waiting for TEVENT_FD_WRITE is needed for getting success,
while TEVENT_FD_READ is required to get failures.

This matches what we have in tstream_bsd_connect_send().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/async_req/async_sock.c