diff options
author | Uri Simchoni <urisimchoni@gmail.com> | 2015-06-25 09:46:24 +0300 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-07-15 22:41:13 +0200 |
commit | 0c6dc1ecf9ae615b19be412b4d80113296628420 (patch) | |
tree | f24091964606707345ac7e77463d2fd41bb413e0 /source3/smbd | |
parent | 28e1cae4918213ba0cc7903a63d6200e69e5d1c7 (diff) | |
download | samba-0c6dc1ecf9ae615b19be412b4d80113296628420.tar.gz |
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>
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/process.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 12ce0d1619c..6c8a31c594e 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -2859,7 +2859,7 @@ static struct tevent_req *smbd_echo_read_send( state->ev = ev; state->xconn = xconn; - subreq = wait_for_read_send(state, ev, xconn->transport.sock); + subreq = wait_for_read_send(state, ev, xconn->transport.sock, false); if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); } @@ -2934,7 +2934,7 @@ static void smbd_echo_read_waited(struct tevent_req *subreq) } subreq = wait_for_read_send(state, state->ev, - xconn->transport.sock); + xconn->transport.sock, false); if (tevent_req_nomem(subreq, req)) { return; } |