From a8e02b591b0c82c1f75f4f51bc683d9775f13d54 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 23 May 2009 16:10:54 +0200 Subject: Add "err_on_readability" to writev_send A socket where the other side has closed only becomes readable. To catch errors early when sitting in a pure writev, we need to also test for readability. --- source3/lib/wb_reqtrans.c | 4 ++-- source3/libsmb/async_smb.c | 4 ++-- source3/rpc_server/srv_pipe_hnd.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/lib/wb_reqtrans.c b/source3/lib/wb_reqtrans.c index df92ecf8b0..3fdf62a108 100644 --- a/source3/lib/wb_reqtrans.c +++ b/source3/lib/wb_reqtrans.c @@ -152,7 +152,7 @@ struct tevent_req *wb_req_write_send(TALLOC_CTX *mem_ctx, count = 2; } - subreq = writev_send(state, ev, queue, fd, state->iov, count); + subreq = writev_send(state, ev, queue, fd, true, state->iov, count); if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); } @@ -309,7 +309,7 @@ struct tevent_req *wb_resp_write_send(TALLOC_CTX *mem_ctx, count = 2; } - subreq = writev_send(state, ev, queue, fd, state->iov, count); + subreq = writev_send(state, ev, queue, fd, true, state->iov, count); if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); } diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 12bc0a6fb3..6edfe514b8 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -680,10 +680,10 @@ static NTSTATUS cli_smb_req_iov_send(struct tevent_req *req, iov[0].iov_base = (void *)buf; iov[0].iov_len = talloc_get_size(buf); subreq = writev_send(state, state->ev, state->cli->outgoing, - state->cli->fd, iov, 1); + state->cli->fd, false, iov, 1); } else { subreq = writev_send(state, state->ev, state->cli->outgoing, - state->cli->fd, iov, iov_count); + state->cli->fd, false, iov, iov_count); } if (subreq == NULL) { return NT_STATUS_NO_MEMORY; diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index f2441619ac..a17adfb7a0 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -1221,7 +1221,7 @@ struct tevent_req *np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev, state->iov.iov_len = len; subreq = writev_send(state, ev, p->write_queue, p->fd, - &state->iov, 1); + false, &state->iov, 1); if (subreq == NULL) { goto fail; } -- cgit