]> source.dussan.org Git - nextcloud-server.git/commitdiff
abandon ongoing paged search before starting a new one
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 18 Sep 2014 15:00:51 +0000 (17:00 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Tue, 30 Sep 2014 10:42:37 +0000 (12:42 +0200)
apps/user_ldap/lib/access.php

index 392c0957d64ef9436de3b12fb23b4bfed2c2298d..760d23bf44c4c87545324b5e2244909e29c8e49f 100644 (file)
@@ -1376,7 +1376,7 @@ class Access extends LDAPUtility implements user\IUserTools {
         * resets a running Paged Search operation
         */
        private function abandonPagedSearch() {
-               if(count($this->cookies) > 0) {
+               if(!empty($this->lastCookie)) {
                        $cr = $this->connection->getConnectionResource();
                        $this->ldap->controlPagedResult($cr, 0, false, $this->lastCookie);
                        $this->getPagedSearchResultState();
@@ -1475,9 +1475,8 @@ class Access extends LDAPUtility implements user\IUserTools {
                                        }
                                }
                                if(!is_null($cookie)) {
-                                       if($offset > 0) {
-                                               \OCP\Util::writeLog('user_ldap', 'Cookie '.CRC32($cookie), \OCP\Util::INFO);
-                                       }
+                                       //since offset = 0, this is a new search. We abandon other searches that might be ongoing.
+                                       $this->abandonPagedSearch();
                                        $pagedSearchOK = $this->ldap->controlPagedResult(
                                                $this->connection->getConnectionResource(), $limit,
                                                false, $cookie);