diff options
author | Jim McDonough <jmcd@samba.org> | 2008-05-13 18:42:18 -0400 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2008-05-13 18:42:18 -0400 |
commit | 2ca5098e3591fa006a90f2f44dc1d5455f501703 (patch) | |
tree | ea90fcb78e241496e8cc1c9e5ae70022b4012050 /source3/smbd/conn.c | |
parent | a6b0ea8ee341fde28e568f8e1a4f16d9a89425c8 (diff) | |
parent | b8398d19af01cbdaec3af6c264e4d073fa85f78d (diff) | |
download | samba-2ca5098e3591fa006a90f2f44dc1d5455f501703.tar.gz samba-2ca5098e3591fa006a90f2f44dc1d5455f501703.tar.bz2 samba-2ca5098e3591fa006a90f2f44dc1d5455f501703.zip |
Merge branch 'v3-3-test' of git://git.samba.org/samba into 3.3-test
(This used to be commit 6dd44ebf22762e852b43e7dbcd095a58cc45abad)
Diffstat (limited to 'source3/smbd/conn.c')
-rw-r--r-- | source3/smbd/conn.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index e899af1319..125277be21 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -63,10 +63,10 @@ bool conn_snum_used(int snum) return(False); } - /**************************************************************************** -find a conn given a cnum + Find a conn given a cnum. ****************************************************************************/ + connection_struct *conn_find(unsigned cnum) { int count=0; @@ -84,6 +84,27 @@ connection_struct *conn_find(unsigned cnum) return NULL; } +/**************************************************************************** + Find a conn given a service name. +****************************************************************************/ + +connection_struct *conn_find_byname(const char *service) +{ + int count=0; + connection_struct *conn; + + for (conn=Connections;conn;conn=conn->next,count++) { + if (strequal(lp_servicename(SNUM(conn)),service)) { + if (count > 10) { + DLIST_PROMOTE(Connections, conn); + } + return conn; + } + } + + return NULL; +} + /**************************************************************************** find first available connection slot, starting from a random position. |