mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +00:00
fix(core): avoid pooling channels with tools (fixes #4684)
This commit is contained in:
@@ -108,6 +108,9 @@
|
||||
- (EOAdaptorChannel *) acquireQuickChannel;
|
||||
- (EOAdaptorChannel *) acquireAclChannel;
|
||||
- (void) releaseChannel: (EOAdaptorChannel *) _channel;
|
||||
- (void) releaseChannel: (EOAdaptorChannel *) _channel
|
||||
immediately: (BOOL) _immediately;
|
||||
|
||||
|
||||
- (BOOL) canConnectStore;
|
||||
- (BOOL) canConnectQuick;
|
||||
|
||||
@@ -248,9 +248,16 @@ static GCSStringFormatter *stringFormatter = nil;
|
||||
return [[self _channelManager] acquireOpenChannelForURL:[self aclLocation]];
|
||||
}
|
||||
|
||||
|
||||
- (void)releaseChannel:(EOAdaptorChannel *)_channel {
|
||||
[self releaseChannel: _channel immediately: NO];
|
||||
}
|
||||
|
||||
- (void) releaseChannel: (EOAdaptorChannel *) _channel
|
||||
immediately: (BOOL) _immediately
|
||||
{
|
||||
if (debugOn) [self debugWithFormat:@"releasing channel: %@", _channel];
|
||||
[[self _channelManager] releaseChannel:_channel];
|
||||
[[self _channelManager] releaseChannel:_channel immediately: _immediately];
|
||||
}
|
||||
|
||||
- (BOOL)canConnectStore {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SOGoToolBackup.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009-2016 Inverse inc.
|
||||
* Copyright (C) 2009-2020 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
|
||||
@@ -168,7 +168,7 @@
|
||||
if (user)
|
||||
[allSqlUsers addObject: user];
|
||||
}
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
|
||||
users = allSqlUsers;
|
||||
max = [users count];
|
||||
@@ -270,7 +270,7 @@
|
||||
row = [fc fetchAttributes: attrs withZone: NULL];
|
||||
displayName = [row objectForKey: @"c_foldername"];
|
||||
[fc cancelFetch];
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
}
|
||||
|
||||
if (!displayName)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SOGoToolCheckup.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2017 Inverse inc.
|
||||
* Copyright (C) 2017-2020 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
|
||||
@@ -128,7 +128,7 @@
|
||||
if (user)
|
||||
[allSqlUsers addObject: user];
|
||||
}
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
|
||||
users = allSqlUsers;
|
||||
max = [users count];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SOGoToolCleanup.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2016 Inverse inc.
|
||||
* Copyright (C) 2016-2020 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
|
||||
@@ -122,7 +122,7 @@
|
||||
if (user)
|
||||
[allSqlUsers addObject: user];
|
||||
}
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
|
||||
users = allSqlUsers;
|
||||
max = [users count];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SOGoToolExpireUserSessions.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2012-2017 Inverse inc.
|
||||
* Copyright (C) 2012-2020 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
|
||||
@@ -134,7 +134,7 @@
|
||||
NSLog(@"No session to remove");
|
||||
}
|
||||
|
||||
[cm releaseChannel: channel];
|
||||
[cm releaseChannel: channel immediately: YES];
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ typedef enum
|
||||
if (u)
|
||||
[allSQLUsers addObject: u];
|
||||
}
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
}
|
||||
|
||||
// We add our system users
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SOGoToolRemove.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2010-2017 Inverse inc.
|
||||
* Copyright (C) 2010-2020 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
|
||||
@@ -105,7 +105,7 @@ static NSURL *tableURL = nil;
|
||||
while ((row = [fc fetchAttributes: attrs withZone: NULL]))
|
||||
[paths addObject: [row objectForKey: @"c_path"]];
|
||||
}
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
}
|
||||
|
||||
return paths;
|
||||
@@ -150,7 +150,7 @@ static NSURL *tableURL = nil;
|
||||
NSLog (@"Unable to delete the preference record for '%@'", userId);
|
||||
else if (verbose)
|
||||
NSLog (@"Removed preference record for '%@'", userId);
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SOGoToolRemoveDoubles.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009-2017 Inverse inc.
|
||||
* Copyright (C) 2009-2020 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
|
||||
@@ -207,7 +207,7 @@
|
||||
usingChannel: channel];
|
||||
|
||||
[context commitTransaction];
|
||||
[folder releaseChannel: channel];
|
||||
[folder releaseChannel: channel immediately: YES];
|
||||
}
|
||||
|
||||
- (NSArray *) namesOfRecords: (NSArray *) records
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SOGoToolRenameUser.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2011-2017 Inverse inc
|
||||
* Copyright (C) 2011-2020 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
|
||||
@@ -147,7 +147,7 @@
|
||||
else
|
||||
rc = [ac commitTransaction];
|
||||
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -200,7 +200,7 @@
|
||||
else
|
||||
rc = [ac commitTransaction];
|
||||
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -245,7 +245,7 @@
|
||||
while ((row = [fc fetchAttributes: attrs withZone: NULL]))
|
||||
[subscribers addObject: [row objectForKey: @"c_uid"]];
|
||||
[fc cancelFetch];
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
|
||||
return subscribers;
|
||||
}
|
||||
@@ -446,7 +446,7 @@
|
||||
sql = [NSString stringWithFormat: @"UPDATE %@ SET c_object = '%@'",
|
||||
[location gcsTableName], newObjectPath];
|
||||
[ac evaluateExpressionX: sql];
|
||||
[cm releaseChannel: ac];
|
||||
[cm releaseChannel: ac immediately: YES];
|
||||
}
|
||||
|
||||
[pool release];
|
||||
@@ -480,7 +480,7 @@
|
||||
fromSQLUser: sqlFromUserID
|
||||
toSQLUser: sqlToUserID];
|
||||
[fc cancelFetch];
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
}
|
||||
|
||||
- (void) _updateForeignACLsForLocation: (NSString *) locationString
|
||||
@@ -505,7 +505,7 @@
|
||||
[location gcsTableName],
|
||||
sqlToUserID, sqlFromUserID];
|
||||
[tc evaluateExpressionX: sql];
|
||||
[cm releaseChannel: tc];
|
||||
[cm releaseChannel: tc immediately: YES];
|
||||
[pool release];
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@
|
||||
fromSQLUser: sqlFromUserID
|
||||
toSQLUser: sqlToUserID];
|
||||
[fc cancelFetch];
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
}
|
||||
|
||||
- (BOOL) proceed
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SOGoToolRestore.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009-2019 Inverse inc.
|
||||
* Copyright (C) 2009-2020 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
|
||||
@@ -312,7 +312,7 @@
|
||||
withString: @"''"],
|
||||
[gcsFolder path]];
|
||||
[fc evaluateExpressionX: sql];
|
||||
[cm releaseChannel: fc];
|
||||
[cm releaseChannel: fc immediately: YES];
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -365,7 +365,7 @@
|
||||
}
|
||||
|
||||
[[channel adaptorContext] commitTransaction];
|
||||
[gcsFolder releaseChannel: channel];
|
||||
[gcsFolder releaseChannel: channel immediately: YES];
|
||||
|
||||
rc = YES;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* SOGoToolTruncateCalendar.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009-2016 Inverse inc.
|
||||
* Copyright (C) 2009-2020 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
|
||||
@@ -108,7 +108,7 @@
|
||||
}
|
||||
|
||||
[context commitTransaction];
|
||||
[folder releaseChannel: channel];
|
||||
[folder releaseChannel: channel immediately: YES];
|
||||
}
|
||||
|
||||
- (BOOL) truncateEntriesFromFolder: (GCSFolder *) folder
|
||||
|
||||
@@ -83,9 +83,9 @@
|
||||
|
||||
- (void) parseArguments: (NSArray *) arguments
|
||||
{
|
||||
BOOL error;
|
||||
int count, max;
|
||||
NSString *argument;
|
||||
int count, max;
|
||||
BOOL error;
|
||||
|
||||
error = NO;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user