summaryrefslogtreecommitdiff
path: root/source4/libcli/composite/savefile.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/savefile.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/savefile.c')
-rw-r--r--source4/libcli/composite/savefile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/libcli/composite/savefile.c b/source4/libcli/composite/savefile.c
index 06eb13bb01..29d26c7eba 100644
--- a/source4/libcli/composite/savefile.c
+++ b/source4/libcli/composite/savefile.c
@@ -29,10 +29,10 @@
/* the stages of this call */
enum savefile_stage {SAVEFILE_OPEN, SAVEFILE_WRITE, SAVEFILE_CLOSE};
-
static void savefile_handler(struct smbcli_request *req);
struct savefile_state {
+ enum savefile_stage stage;
off_t total_written;
struct smb_composite_savefile *io;
union smb_open *io_open;
@@ -62,7 +62,7 @@ static NTSTATUS setup_close(struct smbcli_composite *c,
NT_STATUS_HAVE_NO_MEMORY(state->req);
/* call the handler again when the close is done */
- c->stage = SAVEFILE_CLOSE;
+ state->stage = SAVEFILE_CLOSE;
state->req->async.fn = savefile_handler;
state->req->async.private = c;
@@ -106,7 +106,7 @@ static NTSTATUS savefile_open(struct smbcli_composite *c,
NT_STATUS_HAVE_NO_MEMORY(state->req);
/* call the handler again when the first write is done */
- c->stage = SAVEFILE_WRITE;
+ state->stage = SAVEFILE_WRITE;
state->req->async.fn = savefile_handler;
state->req->async.private = c;
talloc_free(state->io_open);
@@ -189,7 +189,7 @@ static void savefile_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 SAVEFILE_OPEN:
c->status = savefile_open(c, state->io);
break;
@@ -226,12 +226,12 @@ struct smbcli_composite *smb_composite_savefile_send(struct smbcli_tree *tree,
if (c == NULL) goto failed;
c->state = SMBCLI_REQUEST_SEND;
- c->stage = SAVEFILE_OPEN;
c->event_ctx = tree->session->transport->socket->event.ctx;
state = talloc(c, struct savefile_state);
if (state == NULL) goto failed;
+ state->stage = SAVEFILE_OPEN;
state->total_written = 0;
state->io = io;