]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: improve smbXsrv_connection_dbg() for debugging multi-channel problems
authorStefan Metzmacher <metze@samba.org>
Wed, 23 Sep 2020 11:13:01 +0000 (13:13 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 6 Mar 2021 02:20:05 +0000 (02:20 +0000)
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 9e861554fa7b6bf997e55856cf7b08c338731a80..0b02f85c41f6de44462c68ba95747dba75a6bdba 100644 (file)
@@ -3745,16 +3745,23 @@ static void smbd_tevent_trace_callback(enum tevent_trace_point point,
 const char *smbXsrv_connection_dbg(const struct smbXsrv_connection *xconn)
 {
        const char *ret;
-
+       char *addr;
        /*
         * TODO: this can be improved later
         * maybe including the client guid or more
         */
-       ret = tsocket_address_string(xconn->remote_address, talloc_tos());
-       if (ret == NULL) {
+       addr = tsocket_address_string(xconn->remote_address, talloc_tos());
+       if (addr == NULL) {
                return "<tsocket_address_string() failed>";
        }
 
+       ret = talloc_asprintf(talloc_tos(), "ptr=%p,id=%llu,addr=%s",
+                             xconn, (unsigned long long)xconn->channel_id, addr);
+       TALLOC_FREE(addr);
+       if (ret == NULL) {
+               return "<talloc_asprintf() failed>";
+       }
+
        return ret;
 }