Avoid over-using LDAP connections when decomposing groups

pull/17/merge
Ludovic Marcotte 2014-02-14 16:39:26 -05:00
parent ae07de5f6f
commit 75c8362df8
3 changed files with 22 additions and 9 deletions

1
NEWS
View File

@ -45,6 +45,7 @@ Bug fixes
- fixed handling of ACLs on shared calendars with multiple groups (#1854)
- fixed HTML formatting of appointment notifications for Outlook (#2233)
- replace slashes by dashes in filenames of attachments to avoid a 404 return code (#2537)
- avoid over-using LDAP connections when decomposing groups
2.1.1b (2013-12-04)
-------------------

View File

@ -1,10 +1,6 @@
/* SOGoCalendarComponent.m - this file is part of SOGo
*
* Copyright (C) 2006-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Francis Lachapelle <flachapelle@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
* Copyright (C) 2006-2014 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
@ -22,6 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSEnumerator.h>
#import <Foundation/NSProcessInfo.h>
@ -492,18 +489,31 @@
NSMutableArray *allAttendees;
iCalPerson *currentAttendee;
NSEnumerator *enumerator;
NSAutoreleasePool *pool;
SOGoGroup *group;
BOOL eventWasModified;
unsigned int i;
unsigned int i, j;
domain = [[context activeUser] domain];
organizerEmail = [[theEvent organizer] rfc822Email];
eventWasModified = NO;
allAttendees = [NSMutableArray arrayWithArray: [theEvent attendees]];
enumerator = [[theEvent attendees] objectEnumerator];
j = 0;
pool = [[NSAutoreleasePool alloc] init];
while ((currentAttendee = [enumerator nextObject]))
{
if (j%5 == 0)
{
RELEASE(pool);
pool = [[NSAutoreleasePool alloc] init];
}
group = [SOGoGroup groupWithEmail: [currentAttendee rfc822Email]
inDomain: domain];
if (group)
@ -547,11 +557,15 @@
eventWasModified = YES;
}
}
j++;
} // while (currentAttendee ...
if (eventWasModified)
[theEvent setAttendees: allAttendees];
RELEASE(pool);
return eventWasModified;
}

View File

@ -1,8 +1,6 @@
/* SOGoGroup.m - this file is part of SOGo
*
* Copyright (C) 2009-2012 Inverse inc.
*
* Author: Ludovic Marcotte <lmarcotte@inverse.ca>
* Copyright (C) 2009-2014 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