]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: introduce a smbXsrv_connection_destructor()
authorStefan Metzmacher <metze@samba.org>
Wed, 23 Sep 2020 11:13:22 +0000 (13:13 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 6 Mar 2021 02:20:05 +0000 (02:20 +0000)
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 <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/process.c

index 0b02f85c41f6de44462c68ba95747dba75a6bdba..03409742752deee4b94d45e78506a31dbe2f821d 100644 (file)
@@ -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;