mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
s3:smbd: add smbXsrv_connection_dbg()
This is similar to fsp_fnum_dbg() and fsp_str_dbg(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
committed by
Michael Adam
parent
40386ee78d
commit
318eb4b62d
@ -3485,6 +3485,29 @@ static void smbd_tevent_trace_callback(enum tevent_trace_point point,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a debug string for the connection
|
||||
*
|
||||
* This is allocated to talloc_tos() or a string constant
|
||||
* in certain corner cases. The returned string should
|
||||
* hence not be free'd directly but only via the talloc stack.
|
||||
*/
|
||||
const char *smbXsrv_connection_dbg(const struct smbXsrv_connection *xconn)
|
||||
{
|
||||
const char *ret;
|
||||
|
||||
/*
|
||||
* 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) {
|
||||
return "<tsocket_address_string() failed>";
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Process commands from the client
|
||||
****************************************************************************/
|
||||
|
Reference in New Issue
Block a user