summaryrefslogtreecommitdiff
path: root/source4/libcli/composite/loadfile.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-22 02:51:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:06 -0500
commitaefaa18554a55da5b5d9fdb9815eb246b539c8a2 (patch)
tree3a17a5c8251b1e72a72ea7fdfd96db09face2fc3 /source4/libcli/composite/loadfile.c
parentba5d77bebdcf041a3d2b3dd53fb83fe49ecc4100 (diff)
downloadsamba-aefaa18554a55da5b5d9fdb9815eb246b539c8a2.tar.gz
samba-aefaa18554a55da5b5d9fdb9815eb246b539c8a2.tar.bz2
samba-aefaa18554a55da5b5d9fdb9815eb246b539c8a2.zip
r4924: continue the effort to simplify and generalise the composite
interface. This patch removes the "stage" variable, which is really better suited to the backend state structures (This used to be commit 39da684ea8bc72d7a4a12c00eaad56b4f32890a9)
Diffstat (limited to 'source4/libcli/composite/loadfile.c')
-rw-r--r--source4/libcli/composite/loadfile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/libcli/composite/loadfile.c b/source4/libcli/composite/loadfile.c
index 8290876224..b95f43149e 100644
--- a/source4/libcli/composite/loadfile.c
+++ b/source4/libcli/composite/loadfile.c
@@ -33,6 +33,7 @@ enum loadfile_stage {LOADFILE_OPEN, LOADFILE_READ, LOADFILE_CLOSE};
static void loadfile_handler(struct smbcli_request *req);
struct loadfile_state {
+ enum loadfile_stage stage;
struct smb_composite_loadfile *io;
struct smbcli_request *req;
union smb_open *io_open;
@@ -62,7 +63,7 @@ static NTSTATUS setup_close(struct smbcli_composite *c,
/* call the handler again when the close is done */
state->req->async.fn = loadfile_handler;
state->req->async.private = c;
- c->stage = LOADFILE_CLOSE;
+ state->stage = LOADFILE_CLOSE;
return NT_STATUS_OK;
}
@@ -113,7 +114,7 @@ static NTSTATUS loadfile_open(struct smbcli_composite *c,
/* call the handler again when the first read is done */
state->req->async.fn = loadfile_handler;
state->req->async.private = c;
- c->stage = LOADFILE_READ;
+ state->stage = LOADFILE_READ;
talloc_free(state->io_open);
@@ -187,7 +188,7 @@ static void loadfile_handler(struct smbcli_request *req)
/* when this handler is called, the stage indicates what
call has just finished */
- switch (c->stage) {
+ switch (state->stage) {
case LOADFILE_OPEN:
c->status = loadfile_open(c, state->io);
break;
@@ -251,7 +252,7 @@ struct smbcli_composite *smb_composite_loadfile_send(struct smbcli_tree *tree,
/* setup the callback handler */
state->req->async.fn = loadfile_handler;
state->req->async.private = c;
- c->stage = LOADFILE_OPEN;
+ state->stage = LOADFILE_OPEN;
return c;