From: Jeremy Allison Date: Wed, 14 May 2008 21:10:05 +0000 (-0700) Subject: Ensure we don't keep searching for sharename if it's X-Git-Tag: samba-3.3.0pre1~1246 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15857534b76bc66ad122510100aa224f17250465;p=thirdparty%2Fsamba.git Ensure we don't keep searching for sharename if it's not the start of the list. Jeremy. --- diff --git a/source/smbd/conn.c b/source/smbd/conn.c index 125277be211..159b232b5fa 100644 --- a/source/smbd/conn.c +++ b/source/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;