lib/tsocket: make use of TEVENT_FD_ERROR in tstream_bsd_fde_handler()
commit5bedf1675e7b5a960f34beef87da79cad5b696a6
authorStefan Metzmacher <metze@samba.org>
Wed, 11 Jan 2023 19:17:06 +0000 (11 20:17 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 24 Oct 2023 09:36:37 +0000 (24 09:36 +0000)
tree2831fd711eb8866077f43223acc445d14e3327f9
parent22e3a542f39ce3f88c22cf871ebc3228acfc19ba
lib/tsocket: make use of TEVENT_FD_ERROR in tstream_bsd_fde_handler()

This makes the logic introduced to fix bug #15202 simpler.

While developing this I noticed that a lot of callers
rely on the fact that they can read the pending bytes out
of the recv queue before EOF is reported.

So I changed the code handle TEVENT_FD_ERROR together with
TEVENT_FD_READ in a way that keep the existing callers happy.

In the next step we'll add a way to let callers opt-in in order
to fail immediately if TEVENT_FD_ERROR appears (even if there
are pending bytes remaining in the recv queue).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15202

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/tsocket/tsocket_bsd.c