async_req: check for errors when monitoring socket for readability
authorUri Simchoni <urisimchoni@gmail.com>
Thu, 25 Jun 2015 06:46:24 +0000 (09:46 +0300)
committerJeremy Allison <jra@samba.org>
Wed, 15 Jul 2015 20:41:13 +0000 (22:41 +0200)
commit0c6dc1ecf9ae615b19be412b4d80113296628420
treef24091964606707345ac7e77463d2fd41bb413e0
parent28e1cae4918213ba0cc7903a63d6200e69e5d1c7
async_req: check for errors when monitoring socket for readability

Add an option to wait_for_read_send(), so that the request, upon
calling back, report whether the socket actually contains data
or is in EOF/error state. EOF is signalled via the EPIPE error.

This is useful for clients which do not expect data to arrive but
wait for readability to detect a closed socket (i.e. they do not
intend to actually read the socket when it's readable). Actual data
arrival would indicate a bug in this case, so the check can
be used to print an error message.

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

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/async_req/async_sock.c
lib/async_req/async_sock.h
source3/smbd/process.c
source3/winbindd/winbindd.c