Monotone-Parent: 42650c7e11b236bf9b1b25f7089b591ad1af31aa

Monotone-Revision: 6e1bd1891e5cfeca7fa78369305bcad3b36d1955

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-11-19T16:43:29
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2009-11-19 16:43:29 +00:00
parent ddbbb02373
commit cfc6787765
3 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2009-11-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* GCSChannelManager.m (-releaseChannel:immediately:): new method
that enables the immediate release of channels, for handling
connection errors.
2009-10-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* GCSFolder.m (_tableRequirementForFields:andOrQualifier:): fixed

View File

@ -48,6 +48,8 @@
- (EOAdaptorChannel *)acquireOpenChannelForURL:(NSURL *)_url;
- (void)releaseChannel:(EOAdaptorChannel *)_channel;
- (void)releaseChannel:(EOAdaptorChannel *)_channel
immediately:(BOOL)_immediately;
/* checking for tables */

View File

@ -377,6 +377,12 @@ static NSTimeInterval ChannelCollectionTimer = 5 * 60;
}
- (void) releaseChannel: (EOAdaptorChannel *) _channel
{
[self releaseChannel: _channel immediately: NO];
}
- (void) releaseChannel: (EOAdaptorChannel *) _channel
immediately: (BOOL) _immediately
{
GCSChannelHandle *handle;
BOOL keepOpen;
@ -387,13 +393,14 @@ static NSTimeInterval ChannelCollectionTimer = 5 * 60;
handle = [self findBusyChannelHandleForChannel: _channel];
if (handle)
{
handle = [handle retain];
[handle retain];
ASSIGN (handle->lastReleaseTime, [NSCalendarDate date]);
[busyChannels removeObject: handle];
keepOpen = NO;
if ([_channel isOpen] && [handle age] < ChannelExpireAge)
if (!_immediately && [_channel isOpen]
&& [handle age] < ChannelExpireAge)
{
keepOpen = YES;
// TODO: consider age