From ab4d635b92b116b02b88843b4ec4f5b7517bab1a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 26 Sep 2005 11:47:55 +0000 Subject: r10504: - seperate implementation specific stuff, from the generic composite stuff. - don't use SMBCLI_REQUEST_* state's in the genreic composite stuff - move monitor_fn to libnet. NOTE: I have maybe found some bugs, in code that is dirrectly in DONE or ERROR state in the _send() function. I haven't fixed this bugs in this commit! We may need some composite_trigger_*() functions or so. And maybe some other generic helper functions... metze (This used to be commit 4527815a0a9b96e460f301cb1f0c0b3964c166fc) --- source4/libnet/domain.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'source4/libnet/domain.c') diff --git a/source4/libnet/domain.c b/source4/libnet/domain.c index 94a2412261..3a5aecb92e 100644 --- a/source4/libnet/domain.c +++ b/source4/libnet/domain.c @@ -23,9 +23,7 @@ */ #include "includes.h" -#include "libcli/raw/libcliraw.h" #include "libcli/composite/composite.h" -#include "libcli/composite/monitor.h" #include "librpc/gen_ndr/ndr_samr.h" #include "libnet/composite.h" @@ -119,7 +117,7 @@ static NTSTATUS domain_open_open(struct composite_context *c, c->status = dcerpc_ndr_request_recv(s->req); NT_STATUS_NOT_OK_RETURN(c->status); - c->state = SMBCLI_REQUEST_DONE; + c->state = COMPOSITE_STATE_DONE; return NT_STATUS_OK; } @@ -134,8 +132,7 @@ static NTSTATUS domain_open_open(struct composite_context *c, static void domain_open_handler(struct rpc_request *req) { struct composite_context *c = req->async.private; - struct domain_open_state *s = talloc_get_type(c->private, struct domain_open_state); - struct monitor_msg msg; + struct domain_open_state *s = talloc_get_type(c->private_data, struct domain_open_state); /* Stages of the call */ switch (s->stage) { @@ -151,11 +148,7 @@ static void domain_open_handler(struct rpc_request *req) } if (!NT_STATUS_IS_OK(c->status)) { - c->state = SMBCLI_REQUEST_ERROR; - } - - if (c->monitor_fn) { - c->monitor_fn(&msg); + c->state = COMPOSITE_STATE_ERROR; } } @@ -179,10 +172,9 @@ struct composite_context *libnet_rpc_domain_open_send(struct dcerpc_pipe *p, s = talloc_zero(c, struct domain_open_state); if (s == NULL) goto failure; - c->state = SMBCLI_REQUEST_SEND; - c->private = s; + c->state = COMPOSITE_STATE_IN_PROGRESS; + c->private_data= s; c->event_ctx = dcerpc_event_context(p); - c->monitor_fn = monitor; s->pipe = p; s->access_mask = io->in.access_mask; @@ -227,7 +219,7 @@ NTSTATUS libnet_rpc_domain_open_recv(struct composite_context *c, TALLOC_CTX *me status = composite_wait(c); if (NT_STATUS_IS_OK(status) && io) { - s = talloc_get_type(c->private, struct domain_open_state); + s = talloc_get_type(c->private_data, struct domain_open_state); io->out.domain_handle = s->domain_handle; } -- cgit