fix(addressbook): close DB connection after DAV query

This commit is contained in:
Francis Lachapelle
2022-02-01 10:14:37 -05:00
parent 7c81e3acec
commit 348a79c795
4 changed files with 24 additions and 7 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
/* SOGoContactSourceFolder.m - this file is part of SOGo
*
* Copyright (C) 2006-2021 Inverse inc.
* Copyright (C) 2006-2022 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -700,6 +700,7 @@
RELEASE(pool);
[response appendContentString: buffer];
RELEASE(buffer);
[source releaseConnection: connection];
// NSLog (@"/adding properties with url");
NSZoneFree (NULL, propertiesArray);
+7 -1
View File
@@ -1,6 +1,6 @@
/* LDAPSource.m - this file is part of SOGo
*
* Copyright (C) 2007-2021 Inverse inc.
* Copyright (C) 2007-2022 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -497,6 +497,12 @@ groupObjectClasses: (NSArray *) newGroupObjectClasses
return (NGLdapConnection *)[self connection];
}
- (void) releaseConnection: (id) connection
{
if ([(NGLdapConnection *)connection isBound])
[(NGLdapConnection *)connection unbind];
}
- (NSString *) domain
{
return _domain;
+2 -1
View File
@@ -1,6 +1,6 @@
/* SOGoSource.h - this file is part of SOGo
*
* Copyright (C) 2009-2021 Inverse inc.
* Copyright (C) 2009-2022 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,6 +40,7 @@
- (NSArray *) searchFields;
- (id) connection;
- (void) releaseConnection: (id) connection;
/* requires a "." to obtain the full list of contacts */
- (void) setListRequiresDot: (BOOL) aBool;
+13 -4
View File
@@ -440,6 +440,17 @@
return channel;
}
- (void) releaseConnection: (id) connection
{
GCSChannelManager *cm;
if (connection)
{
cm = [GCSChannelManager defaultChannelManager];
[cm releaseChannel: connection];
}
}
- (NSDictionary *) _lookupContactEntry: (NSString *) theID
considerEmail: (BOOL) b
inDomain: (NSString *) domain
@@ -678,18 +689,16 @@
inDomain: (NSString *) domain
{
EOAdaptorChannel *channel;
GCSChannelManager *cm;
NSDictionary *response;
cm = [GCSChannelManager defaultChannelManager];
channel = (EOAdaptorChannel *)[self connection];
response = [self _lookupContactEntry: theID
considerEmail: b
inDomain: domain
usingConnection: channel];
if (channel)
[cm releaseChannel: channel];
[self releaseConnection: channel];
return response;
}