summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/cldap/cldap.c3
-rw-r--r--source4/libcli/dgram/mailslot.c5
-rw-r--r--source4/libcli/ldap/ldap_client.c3
-rw-r--r--source4/libcli/nbt/nbtsocket.c6
-rw-r--r--source4/libcli/raw/clitransport.c7
-rw-r--r--source4/libcli/resolve/host.c3
-rw-r--r--source4/libcli/smb2/transport.c6
-rw-r--r--source4/libcli/wrepl/winsrepl.c9
8 files changed, 13 insertions, 29 deletions
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c
index 58beb1b642..03e690ef18 100644
--- a/source4/libcli/cldap/cldap.c
+++ b/source4/libcli/cldap/cldap.c
@@ -44,9 +44,8 @@
/*
destroy a pending request
*/
-static int cldap_request_destructor(void *ptr)
+static int cldap_request_destructor(struct cldap_request *req)
{
- struct cldap_request *req = talloc_get_type(ptr, struct cldap_request);
if (req->state == CLDAP_REQUEST_SEND) {
DLIST_REMOVE(req->cldap->send_queue, req);
}
diff --git a/source4/libcli/dgram/mailslot.c b/source4/libcli/dgram/mailslot.c
index 467289bcee..775f662370 100644
--- a/source4/libcli/dgram/mailslot.c
+++ b/source4/libcli/dgram/mailslot.c
@@ -41,11 +41,8 @@
/*
destroy a mailslot handler
*/
-static int dgram_mailslot_destructor(void *ptr)
+static int dgram_mailslot_destructor(struct dgram_mailslot_handler *dgmslot)
{
- struct dgram_mailslot_handler *dgmslot =
- talloc_get_type(ptr, struct dgram_mailslot_handler);
-
DLIST_REMOVE(dgmslot->dgmsock->mailslot_handlers, dgmslot);
return 0;
}
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index 8d815c7103..07b7f2b412 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -487,9 +487,8 @@ static void ldap_reconnect(struct ldap_connection *conn)
}
/* destroy an open ldap request */
-static int ldap_request_destructor(void *ptr)
+static int ldap_request_destructor(struct ldap_request *req)
{
- struct ldap_request *req = talloc_get_type(ptr, struct ldap_request);
if (req->state == LDAP_REQUEST_PENDING) {
DLIST_REMOVE(req->conn->pending, req);
}
diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c
index 50da8168e0..7bdeb834f9 100644
--- a/source4/libcli/nbt/nbtsocket.c
+++ b/source4/libcli/nbt/nbtsocket.c
@@ -32,10 +32,8 @@
/*
destroy a pending request
*/
-static int nbt_name_request_destructor(void *ptr)
-{
- struct nbt_name_request *req = talloc_get_type(ptr, struct nbt_name_request);
-
+static int nbt_name_request_destructor(struct nbt_name_request *req)
+{
if (req->state == NBT_REQUEST_SEND) {
DLIST_REMOVE(req->nbtsock->send_queue, req);
}
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 2ad155e9b9..fc257b9098 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -50,10 +50,8 @@ static void smbcli_transport_event_handler(struct event_context *ev,
/*
destroy a transport
*/
-static int transport_destructor(void *ptr)
+static int transport_destructor(struct smbcli_transport *transport)
{
- struct smbcli_transport *transport = ptr;
-
smbcli_transport_dead(transport);
return 0;
}
@@ -538,9 +536,8 @@ static void smbcli_timeout_handler(struct event_context *ev, struct timed_event
/*
destroy a request
*/
-static int smbcli_request_destructor(void *ptr)
+static int smbcli_request_destructor(struct smbcli_request *req)
{
- struct smbcli_request *req = talloc_get_type(ptr, struct smbcli_request);
if (req->state == SMBCLI_REQUEST_RECV) {
DLIST_REMOVE(req->transport->pending_recv, req);
}
diff --git a/source4/libcli/resolve/host.c b/source4/libcli/resolve/host.c
index 781ea957df..18188f7c1c 100644
--- a/source4/libcli/resolve/host.c
+++ b/source4/libcli/resolve/host.c
@@ -51,9 +51,8 @@ struct host_state {
name resolution without leaving a potentially blocking call running
in a child
*/
-static int host_destructor(void *ptr)
+static int host_destructor(struct host_state *state)
{
- struct host_state *state = talloc_get_type(ptr, struct host_state);
close(state->child_fd);
if (state->child != (pid_t)-1) {
kill(state->child, SIGTERM);
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index 6567ad4de7..9b6a39171d 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -51,9 +51,8 @@ static void smb2_transport_event_handler(struct event_context *ev,
/*
destroy a transport
*/
-static int transport_destructor(void *ptr)
+static int transport_destructor(struct smb2_transport *transport)
{
- struct smb2_transport *transport = ptr;
smb2_transport_dead(transport);
return 0;
}
@@ -254,9 +253,8 @@ static void smb2_timeout_handler(struct event_context *ev, struct timed_event *t
/*
destroy a request
*/
-static int smb2_request_destructor(void *ptr)
+static int smb2_request_destructor(struct smb2_request *req)
{
- struct smb2_request *req = talloc_get_type(ptr, struct smb2_request);
if (req->state == SMB2_REQUEST_RECV) {
DLIST_REMOVE(req->transport->pending_recv, req);
}
diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c
index c37d5f9873..a1735c547c 100644
--- a/source4/libcli/wrepl/winsrepl.c
+++ b/source4/libcli/wrepl/winsrepl.c
@@ -144,9 +144,8 @@ static void wrepl_error(void *private, NTSTATUS status)
/*
destroy a wrepl_socket destructor
*/
-static int wrepl_socket_destructor(void *ptr)
+static int wrepl_socket_destructor(struct wrepl_socket *sock)
{
- struct wrepl_socket *sock = talloc_get_type(ptr, struct wrepl_socket);
if (sock->dead) {
sock->free_skipped = True;
return -1;
@@ -244,9 +243,8 @@ failed:
/*
destroy a wrepl_request
*/
-static int wrepl_request_destructor(void *ptr)
+static int wrepl_request_destructor(struct wrepl_request *req)
{
- struct wrepl_request *req = talloc_get_type(ptr, struct wrepl_request);
if (req->state == WREPL_REQUEST_RECV) {
DLIST_REMOVE(req->wrepl_socket->recv_queue, req);
}
@@ -431,9 +429,8 @@ struct wrepl_send_ctrl_state {
struct wrepl_socket *wrepl_sock;
};
-static int wrepl_send_ctrl_destructor(void *ptr)
+static int wrepl_send_ctrl_destructor(struct wrepl_send_ctrl_state *s)
{
- struct wrepl_send_ctrl_state *s = talloc_get_type(ptr, struct wrepl_send_ctrl_state);
struct wrepl_request *req = s->wrepl_sock->recv_queue;
/* check if the request is still in WREPL_STATE_RECV,