mirror of
https://github.com/samba-team/samba.git
synced 2025-12-03 04:23:50 +03:00
r4811: now that the event context is at the socket level, the event cleanup
should be there too
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
7da0af98a0
commit
058ae5527e
@@ -35,6 +35,17 @@ struct clisocket_connect {
|
||||
const char *dest_host;
|
||||
};
|
||||
|
||||
|
||||
static int smbcli_sock_destructor(void *ptr)
|
||||
{
|
||||
struct smbcli_socket *sock = talloc_get_type(ptr, struct smbcli_socket);
|
||||
|
||||
if (sock->event.fde && sock->event.ctx) {
|
||||
event_remove_fd(sock->event.ctx, sock->event.fde);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
create a smbcli_socket context
|
||||
*/
|
||||
@@ -53,6 +64,8 @@ struct smbcli_socket *smbcli_sock_init(TALLOC_CTX *mem_ctx)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
talloc_set_destructor(sock, smbcli_sock_destructor);
|
||||
|
||||
return sock;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ static int transport_destructor(void *ptr)
|
||||
struct smbcli_transport *transport = ptr;
|
||||
|
||||
smbcli_transport_dead(transport);
|
||||
event_remove_fd(transport->socket->event.ctx, transport->socket->event.fde);
|
||||
event_remove_timed(transport->socket->event.ctx, transport->socket->event.te);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user