From cefb797434ef738870b3f2447fdbeea361bdea57 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Dec 2011 12:18:01 +0100 Subject: 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 --- source3/smbd/connection.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/smbd/connection.c') diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c index 5da2b08faa..5a9f4071b4 100644 --- a/source3/smbd/connection.c +++ b/source3/smbd/connection.c @@ -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. ****************************************************************************/ -- cgit