[SCM] Samba Shared Repository - branch master updated -
release-4-0-0alpha6-485-ga66828a
Volker Lendecke
vlendec at samba.org
Thu Feb 5 10:16:25 GMT 2009
The branch, master has been updated
via a66828a37fbb4250dd25c828f3bbb8535fcffea0 (commit)
from 83cf98f113541acca5a9b4d6ad084d401b64706f (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit a66828a37fbb4250dd25c828f3bbb8535fcffea0
Author: Volker Lendecke <vl at samba.org>
Date: Thu Feb 5 11:15:06 2009 +0100
Don't use recvall in the proxied np_read_send
We don't know how much we will get. Resort to a single recv syscall
-----------------------------------------------------------------------
Summary of changes:
source3/rpc_server/srv_pipe_hnd.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index 30d0cf4..4cbe8d6 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -1255,10 +1255,9 @@ struct async_req *np_read_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
struct np_proxy_state *p = talloc_get_type_abort(
handle->private_data, struct np_proxy_state);
- state->nread = len;
state->fd = p->fd;
- subreq = recvall_send(state, ev, p->fd, data, len, 0);
+ subreq = async_recv(state, ev, p->fd, data, len, 0);
if (subreq == NULL) {
goto fail;
}
@@ -1283,14 +1282,21 @@ static void np_read_done(struct async_req *subreq)
subreq->async.priv, struct async_req);
struct np_read_state *state = talloc_get_type_abort(
req->private_data, struct np_read_state);
- NTSTATUS status;
+ ssize_t result;
+ int sys_errno;
int available = 0;
- status = recvall_recv(subreq);
- if (!NT_STATUS_IS_OK(status)) {
- async_req_nterror(req, status);
+ result = async_syscall_result_ssize_t(subreq, &sys_errno);
+ if (result == -1) {
+ async_req_nterror(req, map_nt_error_from_unix(sys_errno));
return;
}
+ if (result == 0) {
+ async_req_nterror(req, NT_STATUS_END_OF_FILE);
+ return;
+ }
+
+ state->nread = result;
/*
* We don't look at the ioctl result. We don't really care if there is
--
Samba Shared Repository
More information about the samba-cvs
mailing list