static void msg_channel_trigger(struct tevent_context *ev,
struct tevent_immediate *im,
void *priv);
-static int msg_channel_init_destructor(struct msg_channel *s);
+static int msg_channel_destructor(struct msg_channel *s);
struct tevent_req *msg_channel_init_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
tevent_req_error(req, map_errno_from_nt_status(status));
return;
}
- talloc_set_destructor(s, msg_channel_init_destructor);
+ talloc_set_destructor(s, msg_channel_destructor);
tevent_req_done(req);
}
-static int msg_channel_init_destructor(struct msg_channel *s)
+static int msg_channel_destructor(struct msg_channel *s)
{
messaging_deregister(s->msg, s->msg_type, s);
return 0;
return;
}
- im = tevent_create_immediate(s->ev);
+ im = tevent_create_immediate(s);
if (im == NULL) {
goto fail;
}
state->rec = talloc_move(state, &channel->msgs[0]);
memmove(channel->msgs, channel->msgs+1,
- sizeof(struct messaging_rec) * (num_msgs-1));
+ sizeof(struct messaging_rec *) * (num_msgs-1));
channel->msgs = talloc_realloc(
channel, channel->msgs, struct messaging_rec *, num_msgs - 1);
return;
}
- ndr_err = ndr_push_struct_blob(
+ ndr_err = ndr_pull_struct_blob(
&blob, state->rec, state->rec,
- (ndr_push_flags_fn_t)ndr_push_messaging_rec);
+ (ndr_pull_flags_fn_t)ndr_pull_messaging_rec);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- DEBUG(0, ("ndr_push_struct_blob failed: %s\n",
+ DEBUG(1, ("ndr_pull_struct_blob failed: %s\n",
ndr_errstr(ndr_err)));
tevent_req_error(req, ndr_map_error2errno(ndr_err));
return;
}
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_DEBUG(messaging_rec, state->rec);
+ }
if (state->rec->msg_type == state->channel->msg_type) {
tevent_req_done(req);
return;