Monotone-Parent: d53f8bb9f0834bbab96c2e6db0136aea6477ee39
Monotone-Revision: f2b7fe7c387ac36654ad3e24e68362b3a0a3f2c8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-12-19T16:18:03 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
ed9fa6463a
commit
896491a24a
|
@ -22,6 +22,7 @@
|
|||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSLock.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
|
@ -41,6 +42,10 @@ static NSString *LDAPContactInfoAttribute = nil;
|
|||
static int timeLimit;
|
||||
static int sizeLimit;
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
static NSLock *lock;
|
||||
#endif
|
||||
|
||||
@implementation LDAPSource
|
||||
|
||||
+ (void) initialize
|
||||
|
@ -126,6 +131,10 @@ static int sizeLimit;
|
|||
@"calFBURL", @"proxyAddresses",
|
||||
nil];
|
||||
[commonSearchFields retain];
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
lock = [NSLock new];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -312,6 +321,10 @@ static int sizeLimit;
|
|||
NSString *userDN;
|
||||
NGLdapConnection *bindConnection;
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock lock];
|
||||
#endif
|
||||
|
||||
didBind = NO;
|
||||
|
||||
if ([loginToCheck length] > 0)
|
||||
|
@ -337,6 +350,10 @@ static int sizeLimit;
|
|||
[bindConnection release];
|
||||
}
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock unlock];
|
||||
#endif
|
||||
|
||||
return didBind;
|
||||
}
|
||||
|
||||
|
@ -431,6 +448,10 @@ static int sizeLimit;
|
|||
NGLdapEntry *currentEntry;
|
||||
NSString *value;
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock lock];
|
||||
#endif
|
||||
|
||||
ids = [NSMutableArray array];
|
||||
|
||||
if ([self _initLDAPConnection])
|
||||
|
@ -455,6 +476,10 @@ static int sizeLimit;
|
|||
|
||||
[ldapConnection autorelease];
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock unlock];
|
||||
#endif
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
|
@ -552,6 +577,10 @@ static int sizeLimit;
|
|||
NGLdapEntry *currentEntry;
|
||||
NSEnumerator *entries;
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock lock];
|
||||
#endif
|
||||
|
||||
contacts = [NSMutableArray array];
|
||||
|
||||
if ([match length] > 0)
|
||||
|
@ -571,6 +600,10 @@ static int sizeLimit;
|
|||
[ldapConnection release];
|
||||
}
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock unlock];
|
||||
#endif
|
||||
|
||||
return contacts;
|
||||
}
|
||||
|
||||
|
@ -579,6 +612,10 @@ static int sizeLimit;
|
|||
NSDictionary *contactEntry;
|
||||
NGLdapEntry *ldapEntry;
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock lock];
|
||||
#endif
|
||||
|
||||
contactEntry = nil;
|
||||
|
||||
if ([entryID length] > 0)
|
||||
|
@ -597,6 +634,10 @@ static int sizeLimit;
|
|||
[ldapConnection autorelease];
|
||||
}
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock unlock];
|
||||
#endif
|
||||
|
||||
return contactEntry;
|
||||
}
|
||||
|
||||
|
@ -607,6 +648,10 @@ static int sizeLimit;
|
|||
NSEnumerator *entries;
|
||||
EOQualifier *qualifier;
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock lock];
|
||||
#endif
|
||||
|
||||
contactEntry = nil;
|
||||
|
||||
if ([uid length] > 0)
|
||||
|
@ -628,6 +673,10 @@ static int sizeLimit;
|
|||
[ldapConnection release];
|
||||
}
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock unlock];
|
||||
#endif
|
||||
|
||||
return contactEntry;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue