From 106121a91b5108bfcc48f641385cd99e7dab7006 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 23 Sep 2020 13:13:22 +0200 Subject: [PATCH] smbd: introduce a smbXsrv_connection_destructor() For now it only prints a debug message, but that's already very useful for multi-channel debugging. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14534 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source3/smbd/process.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 0b02f85c41f..03409742752 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -3765,6 +3765,12 @@ const char *smbXsrv_connection_dbg(const struct smbXsrv_connection *xconn) return ret; } +static int smbXsrv_connection_destructor(struct smbXsrv_connection *xconn) +{ + DBG_DEBUG("xconn[%s]\n", smbXsrv_connection_dbg(xconn)); + return 0; +} + NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd, NTTIME now, struct smbXsrv_connection **_xconn) { @@ -3795,6 +3801,7 @@ NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd, TALLOC_FREE(frame); return NT_STATUS_NO_MEMORY; } + talloc_set_destructor(xconn, smbXsrv_connection_destructor); talloc_steal(frame, xconn); xconn->client = client; xconn->connect_time = now; -- 2.47.3