Projects
Kolab:16:Enterprise
kolab-syncroton
0002-Fix-LDAP-connection-errors-in-Ping-when-us...
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-Fix-LDAP-connection-errors-in-Ping-when-using-active.patch of Package kolab-syncroton (Revision 14)
Currently displaying revision
14
,
Show latest
From ca089e32a5de5eea7766ec6ba69e037242f80f89 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <machniak@kolabsys.com> Date: Wed, 2 Aug 2017 14:07:00 +0200 Subject: [PATCH 02/15] Fix LDAP connection errors in Ping when using activesync_gal_sync When the LDAP addressbook is used for syncronization we have to deal with closing and re-creating LDAP connections on sleep(). --- lib/kolab_sync.php | 21 +++++++++++++++++++++ lib/kolab_sync_data_gal.php | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/kolab_sync.php b/lib/kolab_sync.php index 5e9d262..c6cb192 100644 --- a/lib/kolab_sync.php +++ b/lib/kolab_sync.php @@ -492,4 +492,25 @@ class kolab_sync extends rcube self::console($log); } } + + /** + * When you're going to sleep the script execution for a longer time + * it is good to close all external connections (sql, memcache, SMTP, IMAP). + * + * No action is required on wake up, all connections will be + * re-established automatically. + */ + public function sleep() + { + parent::sleep(); + + // We'll have LDAP addressbooks here if using activesync_gal_sync + if ($this->config->get('activesync_gal_sync')) { + foreach (kolab_sync_data_gal::$address_books as $book) { + $book->close(); + } + + kolab_sync_data_gal::$address_books = array(); + } + } } diff --git a/lib/kolab_sync_data_gal.php b/lib/kolab_sync_data_gal.php index 95894e7..09238f4 100644 --- a/lib/kolab_sync_data_gal.php +++ b/lib/kolab_sync_data_gal.php @@ -42,7 +42,7 @@ class kolab_sync_data_gal extends kolab_sync_data implements Syncroton_Data_IDat * * @var array */ - protected static $address_books = array(); + public static $address_books = array(); /** * Mapping from ActiveSync Contacts namespace fields -- 2.13.2
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.