From 665065a1df9a6fff2c2f26d72b7b3453fcb93d30 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Tue, 8 May 2007 22:08:26 +0000 Subject: r22764: - replace talloc_zero with composite_create - use event context provided with libnet context instead of creating a new one rafal (This used to be commit ce8414b3daad335eac356a393f1653e2e10e2640) --- source4/libnet/libnet_lookup.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c index ebf9b4842d..1c60bfc41d 100644 --- a/source4/libnet/libnet_lookup.c +++ b/source4/libnet/libnet_lookup.c @@ -59,21 +59,13 @@ struct composite_context *libnet_Lookup_send(struct libnet_context *ctx, const char** methods; /* allocate context and state structures */ - c = talloc_zero(NULL, struct composite_context); + c = composite_create(ctx, ctx->event_ctx); if (c == NULL) return NULL; s = talloc_zero(c, struct lookup_state); - if (s == NULL) { - composite_error(c, NT_STATUS_NO_MEMORY); - return c; - } - - /* prepare event context */ - c->event_ctx = event_context_find(c); - if (c->event_ctx == NULL) { - composite_error(c, NT_STATUS_NO_MEMORY); - return c; - } + if (composite_nomem(s, c)) return c; + + c->private_data = s; if (io == NULL || io->in.hostname == NULL) { composite_error(c, NT_STATUS_INVALID_PARAMETER); @@ -92,14 +84,11 @@ struct composite_context *libnet_Lookup_send(struct libnet_context *ctx, methods = ctx->name_res_methods; } - c->private_data = s; - c->state = COMPOSITE_STATE_IN_PROGRESS; - /* send resolve request */ cresolve_req = resolve_name_send(&s->hostname, c->event_ctx, methods); + if (composite_nomem(cresolve_req, c)) return c; composite_continue(c, cresolve_req, continue_name_resolved, c); - return c; } -- cgit