mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
s3:smbd: add connections_snum_used()
This works similar to conn_snum_used(), but instead of looking at the current connection only, it looks at all active connections in "connections.tdb". metze
This commit is contained in:
parent
611ab8aaa7
commit
cefb797434
@ -130,6 +130,18 @@ int count_current_connections( const char *sharename, bool clear )
|
||||
return cs.curr_connections;
|
||||
}
|
||||
|
||||
bool connections_snum_used(struct smbd_server_connection *unused, int snum)
|
||||
{
|
||||
int active;
|
||||
|
||||
active = count_current_connections(lp_servicename(snum), true);
|
||||
if (active > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Claim an entry in the connections database.
|
||||
****************************************************************************/
|
||||
|
@ -164,6 +164,7 @@ void msg_force_tdis(struct messaging_context *msg,
|
||||
|
||||
bool yield_connection(connection_struct *conn, const char *name);
|
||||
int count_current_connections( const char *sharename, bool clear );
|
||||
bool connections_snum_used(struct smbd_server_connection *unused, int snum);
|
||||
bool claim_connection(connection_struct *conn, const char *name);
|
||||
|
||||
/* The following definitions come from smbd/dfree.c */
|
||||
|
Loading…
x
Reference in New Issue
Block a user