mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-31 08:04:54 +00:00
fix(addressbook): close DB connection after DAV query
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user