diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-09-26 11:47:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:57 -0500 |
commit | ab4d635b92b116b02b88843b4ec4f5b7517bab1a (patch) | |
tree | 63c3ee12153b629071d2ba0209a0a31b134c449e /source4/libcli/resolve/host.c | |
parent | 0d46be147a1e755bdd6f21a5ddc83b5c39585529 (diff) | |
download | samba-ab4d635b92b116b02b88843b4ec4f5b7517bab1a.tar.gz |
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)
Diffstat (limited to 'source4/libcli/resolve/host.c')
-rw-r--r-- | source4/libcli/resolve/host.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source4/libcli/resolve/host.c b/source4/libcli/resolve/host.c index a5edfcbc8a9..13503b66b37 100644 --- a/source4/libcli/resolve/host.c +++ b/source4/libcli/resolve/host.c @@ -66,7 +66,7 @@ static int host_destructor(void *ptr) */ static void run_child(struct composite_context *c, int fd) { - struct host_state *state = talloc_get_type(c->private, struct host_state); + struct host_state *state = talloc_get_type(c->private_data, struct host_state); struct ipv4_addr ip; const char *address; @@ -84,10 +84,10 @@ static void run_child(struct composite_context *c, int fd) handle a read event on the pipe */ static void pipe_handler(struct event_context *ev, struct fd_event *fde, - uint16_t flags, void *private) + uint16_t flags, void *private_data) { - struct composite_context *c = talloc_get_type(private, struct composite_context); - struct host_state *state = talloc_get_type(c->private, struct host_state); + struct composite_context *c = talloc_get_type(private_data, struct composite_context); + struct host_state *state = talloc_get_type(c->private_data, struct host_state); char address[128]; int ret; @@ -113,7 +113,7 @@ static void pipe_handler(struct event_context *ev, struct fd_event *fde, if (state->reply_addr == NULL) goto failed; c->status = NT_STATUS_OK; - c->state = SMBCLI_REQUEST_DONE; + c->state = COMPOSITE_STATE_DONE; if (c->async.fn) { c->async.fn(c); } @@ -121,7 +121,7 @@ static void pipe_handler(struct event_context *ev, struct fd_event *fde, failed: c->status = NT_STATUS_BAD_NETWORK_NAME; - c->state = SMBCLI_REQUEST_ERROR; + c->state = COMPOSITE_STATE_ERROR; if (c->async.fn) { c->async.fn(c); } @@ -148,8 +148,8 @@ struct composite_context *resolve_name_host_send(struct nbt_name *name, status = nbt_name_dup(state, name, &state->name); if (!NT_STATUS_IS_OK(status)) goto failed; - c->state = SMBCLI_REQUEST_SEND; - c->private = state; + c->state = COMPOSITE_STATE_IN_PROGRESS; + c->private_data = state; c->event_ctx = talloc_reference(c, event_ctx); /* setup a pipe to chat to our child */ @@ -206,7 +206,7 @@ NTSTATUS resolve_name_host_recv(struct composite_context *c, status = composite_wait(c); if (NT_STATUS_IS_OK(status)) { - struct host_state *state = talloc_get_type(c->private, struct host_state); + struct host_state *state = talloc_get_type(c->private_data, struct host_state); *reply_addr = talloc_steal(mem_ctx, state->reply_addr); } |