From 96ef630ba33f23125b2d7c6c2fa74b524f285c1e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 14 May 2008 14:10:05 -0700 Subject: Ensure we don't keep searching for sharename if it's not the start of the list. Jeremy. (This used to be commit 15857534b76bc66ad122510100aa224f17250465) --- source3/smbd/conn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c index 125277be21..159b232b5f 100644 --- a/source3/smbd/conn.c +++ b/source3/smbd/conn.c @@ -90,12 +90,12 @@ connection_struct *conn_find(unsigned cnum) connection_struct *conn_find_byname(const char *service) { - int count=0; connection_struct *conn; - for (conn=Connections;conn;conn=conn->next,count++) { + for (conn=Connections;conn;conn=conn->next) { if (strequal(lp_servicename(SNUM(conn)),service)) { - if (count > 10) { + if (conn != Connections) { + /* Promote if not first. */ DLIST_PROMOTE(Connections, conn); } return conn; -- cgit