Skip to content

Commit

Permalink
libcli/cldap: pass tevent_context to cldap_set_incoming_handler()
Browse files Browse the repository at this point in the history
metze
  • Loading branch information
metze-samba committed Oct 10, 2011
1 parent ec0c1f2 commit 3ed85d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion libcli/cldap/cldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct cldap_socket {

/* what to do with incoming request packets */
struct {
struct tevent_context *ev;
void (*handler)(struct cldap_socket *,
void *private_data,
struct cldap_incoming *);
Expand Down Expand Up @@ -381,6 +382,7 @@ NTSTATUS cldap_socket_init(TALLOC_CTX *mem_ctx,
setup a handler for incoming requests
*/
NTSTATUS cldap_set_incoming_handler(struct cldap_socket *c,
struct tevent_context *ev,
void (*handler)(struct cldap_socket *,
void *private_data,
struct cldap_incoming *),
Expand All @@ -394,7 +396,7 @@ NTSTATUS cldap_set_incoming_handler(struct cldap_socket *c,
if (c->event.allow_poll) {
return NT_STATUS_INVALID_PIPE_STATE;
}

c->incoming.ev = ev;
c->incoming.handler = handler;
c->incoming.private_data = private_data;

Expand Down
1 change: 1 addition & 0 deletions libcli/cldap/cldap.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ NTSTATUS cldap_socket_init(TALLOC_CTX *mem_ctx,
struct cldap_socket **_cldap);

NTSTATUS cldap_set_incoming_handler(struct cldap_socket *cldap,
struct tevent_context *ev,
void (*handler)(struct cldap_socket *,
void *private_data,
struct cldap_incoming *),
Expand Down
3 changes: 2 additions & 1 deletion source4/cldap_server/cldap_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ static NTSTATUS cldapd_add_socket(struct cldapd_server *cldapd, struct loadparm_
}
talloc_free(socket_address);

cldap_set_incoming_handler(cldapsock, cldapd_request_handler, cldapd);
cldap_set_incoming_handler(cldapsock, cldapd->task->event_ctx,
cldapd_request_handler, cldapd);

return NT_STATUS_OK;
}
Expand Down

0 comments on commit 3ed85d7

Please sign in to comment.