const struct dcerpc_binding_vector *v,
struct dcerpc_binding_handle **pbh);
-struct rpc_ep_regsiter_state {
+struct rpc_ep_register_state {
struct dcerpc_binding_handle *h;
- TALLOC_CTX *mem_ctx;
struct tevent_context *ev_ctx;
struct messaging_context *msg_ctx;
const struct ndr_interface_table *iface,
const struct dcerpc_binding_vector *v)
{
- struct rpc_ep_regsiter_state *state;
+ struct rpc_ep_register_state *state;
struct tevent_req *req;
- state = talloc(ev_ctx, struct rpc_ep_regsiter_state);
+ state = talloc(ev_ctx, struct rpc_ep_register_state);
if (state == NULL) {
return NT_STATUS_NO_MEMORY;
}
- state->mem_ctx = talloc_named(state,
- 0,
- "ep %s %p",
- iface->name, state);
- if (state->mem_ctx == NULL) {
- talloc_free(state);
- return NT_STATUS_NO_MEMORY;
- }
-
state->wait_time = 1;
state->ev_ctx = ev_ctx;
state->msg_ctx = msg_ctx;
return NT_STATUS_NO_MEMORY;
}
- req = tevent_wakeup_send(state->mem_ctx,
+ req = tevent_wakeup_send(state,
state->ev_ctx,
timeval_current_ofs(1, 0));
- if (tevent_req_nomem(state->mem_ctx, req)) {
+ if (req == NULL) {
talloc_free(state);
return NT_STATUS_NO_MEMORY;
}
static void rpc_ep_register_loop(struct tevent_req *subreq)
{
- struct rpc_ep_regsiter_state *state =
- tevent_req_callback_data(subreq, struct rpc_ep_regsiter_state);
+ struct rpc_ep_register_state *state =
+ tevent_req_callback_data(subreq, struct rpc_ep_register_state);
NTSTATUS status;
bool ok;
return;
}
- status = rpc_ep_try_register(state->mem_ctx,
+ status = rpc_ep_try_register(state,
state->ev_ctx,
state->msg_ctx,
state->iface,
&state->h);
if (NT_STATUS_IS_OK(status)) {
/* endpoint registered, monitor the connnection. */
- subreq = tevent_wakeup_send(state->mem_ctx,
+ subreq = tevent_wakeup_send(state,
state->ev_ctx,
timeval_current_ofs(MONITOR_WAIT_TIME, 0));
- if (tevent_req_nomem(state->mem_ctx, subreq)) {
+ if (subreq == NULL) {
talloc_free(state);
return;
}
state->wait_time = 16;
}
- subreq = tevent_wakeup_send(state->mem_ctx,
+ subreq = tevent_wakeup_send(state,
state->ev_ctx,
timeval_current_ofs(state->wait_time, 0));
- if (tevent_req_nomem(state->mem_ctx, subreq)) {
+ if (subreq == NULL) {
talloc_free(state);
return;
}
*/
static void rpc_ep_monitor_loop(struct tevent_req *subreq)
{
- struct rpc_ep_regsiter_state *state =
- tevent_req_callback_data(subreq, struct rpc_ep_regsiter_state);
+ struct rpc_ep_register_state *state =
+ tevent_req_callback_data(subreq, struct rpc_ep_register_state);
struct policy_handle entry_handle;
struct dcerpc_binding map_binding;
struct epm_twr_p_t towers[10];
ok = tevent_wakeup_recv(subreq);
TALLOC_FREE(subreq);
if (!ok) {
+ talloc_free(tmp_ctx);
talloc_free(state);
return;
}
&result);
talloc_free(tmp_ctx);
- subreq = tevent_wakeup_send(state->mem_ctx,
+ subreq = tevent_wakeup_send(state,
state->ev_ctx,
timeval_current_ofs(MONITOR_WAIT_TIME, 0));
- if (tevent_req_nomem(state->mem_ctx, subreq)) {
+ if (subreq == NULL) {
talloc_free(state);
return;
}