}
if (pc->p != NULL) {
+ if (pc->p->current_req != NULL) {
+ tevent_req_nterror(pc->p->current_req,
+ NT_STATUS_RPC_PIPE_CLOSED);
+ }
pc->p->pc = NULL;
}
static int dcerpc_pipe_handle_destructor(struct dcerpc_pipe_handle *p)
{
dcerpc_pipe_handle_connection_disconnect(p->pc);
-
- if (p->current_req) {
- tevent_req_received(p->current_req);
- }
-
return 0;
}
state->ops = p->ops;
state->p = p;
+ tevent_req_defer_callback(req, ev);
+
talloc_set_destructor(state, dcerpc_pipe_handle_push_state_destructor);
p->current_req = req;
state->ops = p->ops;
state->p = p;
+ tevent_req_defer_callback(req, ev);
+
talloc_set_destructor(state, dcerpc_pipe_handle_pull_state_destructor);
p->current_req = req;