summaryrefslogtreecommitdiffstats
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-02-01 16:32:02 +0100
committerVolker Lendecke <vl@samba.org>2009-02-01 19:05:39 +0100
commitc14b7e648bcfc4865da4b290e46977fff81d4500 (patch)
tree0986bdd1520bf5df0d17d05f35873154756331cb /source3/libsmb
parent0931bb8937eaec55844dee0cdeefafa162053c53 (diff)
downloadsamba-c14b7e648bcfc4865da4b290e46977fff81d4500.tar.gz
samba-c14b7e648bcfc4865da4b290e46977fff81d4500.tar.xz
samba-c14b7e648bcfc4865da4b290e46977fff81d4500.zip
Split up async_req into a generic and a NTSTATUS specific part
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/async_smb.c4
-rw-r--r--source3/libsmb/cliconnect.c8
-rw-r--r--source3/libsmb/clientgen.c6
-rw-r--r--source3/libsmb/clifile.c6
-rw-r--r--source3/libsmb/clireadwrite.c32
-rw-r--r--source3/libsmb/clitrans.c14
6 files changed, 35 insertions, 35 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 18e5a71ee2..e579d1c9f0 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -979,7 +979,7 @@ static void handle_incoming_pdu(struct cli_state *cli)
nt_errstr(status)));
for (req = cli->outstanding_requests; req; req = req->next) {
- async_req_error(req->async[0], status);
+ async_req_nterror(req->async[0], status);
}
return;
}
@@ -1110,7 +1110,7 @@ static void cli_state_handler(struct event_context *event_ctx,
num_async = req->num_async;
for (i=0; i<num_async; i++) {
- async_req_error(req->async[i], status);
+ async_req_nterror(req->async[i], status);
}
}
TALLOC_FREE(cli->fd_event);
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index ed5adc5694..60b1a6027c 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -215,7 +215,7 @@ NTSTATUS cli_session_setup_guest_recv(struct async_req *req)
uint8_t *p;
NTSTATUS status;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
@@ -1283,7 +1283,7 @@ struct async_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx,
access_denied:
result = async_req_new(mem_ctx);
- if (async_post_status(result, ev, NT_STATUS_ACCESS_DENIED)) {
+ if (async_post_ntstatus(result, ev, NT_STATUS_ACCESS_DENIED)) {
return result;
}
TALLOC_FREE(result);
@@ -1301,7 +1301,7 @@ NTSTATUS cli_tcon_andx_recv(struct async_req *req)
uint8_t *bytes;
NTSTATUS status;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
@@ -1483,7 +1483,7 @@ NTSTATUS cli_negprot_recv(struct async_req *req)
NTSTATUS status;
uint16_t protnum;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index a41aa11f7a..0382ef5fae 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -650,7 +650,7 @@ static void cli_echo_recv_helper(struct async_req *req)
status = cli_pull_reply(req, &wct, &vwv, &num_bytes, &bytes);
if (!NT_STATUS_IS_OK(status)) {
- async_req_error(req, status);
+ async_req_nterror(req, status);
return;
}
@@ -659,7 +659,7 @@ static void cli_echo_recv_helper(struct async_req *req)
if ((num_bytes != cli_req->data.echo.data.length)
|| (memcmp(cli_req->data.echo.data.data, bytes,
num_bytes) != 0)) {
- async_req_error(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
+ async_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
return;
}
@@ -727,7 +727,7 @@ struct async_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
NTSTATUS cli_echo_recv(struct async_req *req)
{
- return async_req_simple_recv(req);
+ return async_req_simple_recv_ntstatus(req);
}
/**
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 91f13a79ac..0703f04c5f 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -836,7 +836,7 @@ NTSTATUS cli_ntcreate_recv(struct async_req *req, uint16_t *pfnum)
uint8_t *bytes;
NTSTATUS status;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
@@ -1049,7 +1049,7 @@ NTSTATUS cli_open_recv(struct async_req *req, int *fnum)
uint8_t *bytes;
NTSTATUS status;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
@@ -1127,7 +1127,7 @@ NTSTATUS cli_close_recv(struct async_req *req)
uint8_t *bytes;
NTSTATUS status;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 1ba93d827d..26fa614f69 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -148,7 +148,7 @@ NTSTATUS cli_read_andx_recv(struct async_req *req, ssize_t *received,
NTSTATUS status;
size_t size;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
@@ -297,7 +297,7 @@ struct async_req *cli_pull_send(TALLOC_CTX *mem_ctx,
state->top_req = 0;
if (size == 0) {
- if (!async_post_status(result, ev, NT_STATUS_OK)) {
+ if (!async_post_ntstatus(result, ev, NT_STATUS_OK)) {
goto failed;
}
return result;
@@ -367,7 +367,7 @@ static void cli_pull_read_done(struct async_req *read_req)
status = cli_read_andx_recv(read_req, &read_state->data.read.received,
&read_state->data.read.rcvbuf);
if (!NT_STATUS_IS_OK(status)) {
- async_req_error(state->req, status);
+ async_req_nterror(state->req, status);
return;
}
@@ -404,7 +404,7 @@ static void cli_pull_read_done(struct async_req *read_req)
top_read->data.read.received,
state->priv);
if (!NT_STATUS_IS_OK(status)) {
- async_req_error(state->req, status);
+ async_req_nterror(state->req, status);
return;
}
state->pushed += top_read->data.read.received;
@@ -432,7 +432,7 @@ static void cli_pull_read_done(struct async_req *read_req)
state->start_offset + state->requested,
request_thistime);
- if (async_req_nomem(new_req, state->req)) {
+ if (async_req_ntnomem(new_req, state->req)) {
return;
}
@@ -455,7 +455,7 @@ NTSTATUS cli_pull_recv(struct async_req *req, SMB_OFF_T *received)
req->private_data, struct cli_pull_state);
NTSTATUS status;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
*received = state->pushed;
@@ -792,7 +792,7 @@ NTSTATUS cli_write_andx_recv(struct async_req *req, size_t *pwritten)
NTSTATUS status;
size_t written;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}
@@ -879,14 +879,14 @@ static void cli_writeall_written(struct async_req *subreq)
status = cli_write_andx_recv(subreq, &written);
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
- async_req_error(req, status);
+ async_req_nterror(req, status);
return;
}
state->written += written;
if (state->written > state->size) {
- async_req_error(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
+ async_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
return;
}
@@ -902,7 +902,7 @@ static void cli_writeall_written(struct async_req *subreq)
state->buf + state->written,
state->offset + state->written, to_write);
if (subreq == NULL) {
- async_req_error(req, NT_STATUS_NO_MEMORY);
+ async_req_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
@@ -912,7 +912,7 @@ static void cli_writeall_written(struct async_req *subreq)
static NTSTATUS cli_writeall_recv(struct async_req *req)
{
- return async_req_simple_recv(req);
+ return async_req_simple_recv_ntstatus(req);
}
struct cli_push_state {
@@ -1018,7 +1018,7 @@ struct async_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
}
if (i == 0) {
- if (!async_post_status(result, ev, NT_STATUS_OK)) {
+ if (!async_post_ntstatus(result, ev, NT_STATUS_OK)) {
goto failed;
}
return result;
@@ -1047,7 +1047,7 @@ static void cli_push_written(struct async_req *req)
}
if (i == state->num_reqs) {
- async_req_error(state->req, NT_STATUS_INTERNAL_ERROR);
+ async_req_nterror(state->req, NT_STATUS_INTERNAL_ERROR);
return;
}
@@ -1055,7 +1055,7 @@ static void cli_push_written(struct async_req *req)
TALLOC_FREE(state->reqs[i]);
req = NULL;
if (!NT_STATUS_IS_OK(status)) {
- async_req_error(state->req, status);
+ async_req_nterror(state->req, status);
return;
}
@@ -1081,7 +1081,7 @@ static void cli_push_written(struct async_req *req)
state->reqs, state->ev, state->cli, state->fnum,
state->mode, buf, state->start_offset + state->sent, to_write);
if (state->reqs[i] == NULL) {
- async_req_error(state->req, NT_STATUS_NO_MEMORY);
+ async_req_nterror(state->req, NT_STATUS_NO_MEMORY);
return;
}
@@ -1094,7 +1094,7 @@ static void cli_push_written(struct async_req *req)
NTSTATUS cli_push_recv(struct async_req *req)
{
- return async_req_simple_recv(req);
+ return async_req_simple_recv_ntstatus(req);
}
NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c
index 4a0fc5f6e9..69e2be3af7 100644
--- a/source3/libsmb/clitrans.c
+++ b/source3/libsmb/clitrans.c
@@ -962,7 +962,7 @@ static void cli_trans_ship_rest(struct async_req *req,
{
state->secondary_request_ctx = talloc_new(state);
if (state->secondary_request_ctx == NULL) {
- async_req_error(req, NT_STATUS_NO_MEMORY);
+ async_req_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
@@ -972,7 +972,7 @@ static void cli_trans_ship_rest(struct async_req *req,
cli_req = cli_ship_trans(state->secondary_request_ctx, state);
if (cli_req == NULL) {
- async_req_error(req, NT_STATUS_NO_MEMORY);
+ async_req_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
}
@@ -1133,7 +1133,7 @@ static void cli_trans_recv_helper(struct async_req *req)
*/
if (NT_STATUS_IS_ERR(status)) {
- async_req_error(req, status);
+ async_req_nterror(req, status);
return;
}
@@ -1154,7 +1154,7 @@ static void cli_trans_recv_helper(struct async_req *req)
state->rsetup = (uint16_t *)TALLOC_MEMDUP(
state, setup, sizeof(uint16_t) * num_setup);
if (state->rsetup == NULL) {
- async_req_error(req, NT_STATUS_NO_MEMORY);
+ async_req_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
}
@@ -1165,7 +1165,7 @@ static void cli_trans_recv_helper(struct async_req *req)
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("Pulling params failed: %s\n", nt_errstr(status)));
- async_req_error(req, status);
+ async_req_nterror(req, status);
return;
}
@@ -1175,7 +1175,7 @@ static void cli_trans_recv_helper(struct async_req *req)
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("Pulling data failed: %s\n", nt_errstr(status)));
- async_req_error(req, status);
+ async_req_nterror(req, status);
return;
}
@@ -1318,7 +1318,7 @@ NTSTATUS cli_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
cli_req->recv_helper.priv, struct cli_trans_state);
NTSTATUS status;
- if (async_req_is_error(req, &status)) {
+ if (async_req_is_nterror(req, &status)) {
return status;
}