2003-03-03 Manuel Guesdon <mguesdon@orange-concept.com>

* GSWeb/GSWSessionTimeOutManager.m:
		o Better handling of lock during exceptions
		(should improve it)
		o logs
	* GSWeb/GSWSessionStore.m:
		o logs
		o raise exception when a direct GSWSessionStore is allocated
	* GSWeb/GSWrequest.m:
		o fixed typo on  contentSubType
	* GSWeb/GSWDisplayGroup.hm
		o added _queryMinMatch to enable >= clause
		o added _queryMaxMatch to enable <= clause
		o added -queryMinMatch to enable >= clause
		o added -queryMaxMatch to enable <= clause
		o declare private methods
	* GSWeb/GSWDisplayGroup.m:
		o add NSAutoreleasePool use in -fetch
	* GSWeb/GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd
		o bug fix in GSWHyperlink binding
	* GSWeb/GSWCheckBoxList.m
		o settable selections fix
	* GSWeb/GSWApplication.m:
		o logs
	* GSWeb/GSWSessionTimeOut.[hm]
		o added -lastAccessTimeDate and -timeOutTimeDate
	* GSWeb/GSWDeployedBundle.m:
		o add some NSAutoreleasePool use
	* GSWeb/GSWHyperlink.m:
		o fix to not display links disabled by !enabled when displayDisabled = NO.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@16110 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mguesdon 2003-03-03 08:47:29 +00:00
parent 2e0c8afdee
commit 6104dbcda5
14 changed files with 466 additions and 210 deletions

View file

@ -1,3 +1,34 @@
2003-03-03 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb/GSWSessionTimeOutManager.m:
o Better handling of lock during exceptions
(should improve it)
o logs
* GSWeb/GSWSessionStore.m:
o logs
o raise exception when a direct GSWSessionStore is allocated
* GSWeb/GSWrequest.m:
o fixed typo on contentSubType
* GSWeb/GSWDisplayGroup.hm
o added _queryMinMatch to enable >= clause
o added _queryMaxMatch to enable <= clause
o added -queryMinMatch to enable >= clause
o added -queryMaxMatch to enable <= clause
o declare private methods
* GSWeb/GSWDisplayGroup.m:
o add NSAutoreleasePool use in -fetch
* GSWeb/GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd
o bug fix in GSWHyperlink binding
* GSWeb/GSWCheckBoxList.m
o settable selections fix
* GSWeb/GSWApplication.m:
o logs
* GSWeb/GSWSessionTimeOut.[hm]
o added -lastAccessTimeDate and -timeOutTimeDate
* GSWeb/GSWDeployedBundle.m:
o add some NSAutoreleasePool use
* GSWeb/GSWHyperlink.m:
o fix to not display links disabled by !enabled when displayDisabled = NO.
2003-02-28 David Ayers <d.ayers@inode.at> 2003-02-28 David Ayers <d.ayers@inode.at>
* GSWAdaptors/Apache/mod_gsweb.c (sendResponse): Add cast. * GSWAdaptors/Apache/mod_gsweb.c (sendResponse): Add cast.

View file

@ -60,7 +60,7 @@ FileLinkWithPath: GSWHyperlink
FileLinkWithURL: GSWHyperlink FileLinkWithURL: GSWHyperlink
{ {
src=fileInfo.fileURL; href=fileInfo.fileURL;
string= ^string; string= ^string;
target = ^target; target = ^target;
}; };

View file

@ -1848,6 +1848,7 @@ selfLockn,
//setSessionStore: //setSessionStore:
-(void)setSessionStore:(GSWSessionStore*)sessionStore -(void)setSessionStore:(GSWSessionStore*)sessionStore
{ {
NSDebugMLog(@"sessionStore %@=%@",[sessionStore class],sessionStore);
ASSIGN(_sessionStore,sessionStore); ASSIGN(_sessionStore,sessionStore);
}; };

View file

@ -120,9 +120,9 @@ Bindings
_selections = [[associations objectForKey:selections__Key _selections = [[associations objectForKey:selections__Key
withDefaultObject:[_selections autorelease]] retain]; withDefaultObject:[_selections autorelease]] retain];
NSDebugMLLog(@"gswdync",@"selections=%@",_selections); NSDebugMLLog(@"gswdync",@"selections=%@",_selections);
if (![_selections isValueSettable]) if (_selections && ![_selections isValueSettable])
{ {
ExceptionRaise0(@"GSWCheckBoxList",@"'selection' parameter must be settable"); ExceptionRaise0(@"GSWCheckBoxList",@"'selections' parameter must be settable");
}; };
if (!WOStrictFlag) if (!WOStrictFlag)

View file

@ -364,6 +364,9 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",aName,aDirectory,aLanguage); NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",aName,aDirectory,aLanguage);
if (aName) if (aName)
{
NSAutoreleasePool* arp = [NSAutoreleasePool new];
NS_DURING
{ {
NSString* emptyString=[NSString string]; NSString* emptyString=[NSString string];
NSString* bundlePath=[self bundlePath]; NSString* bundlePath=[self bundlePath];
@ -417,6 +420,21 @@ static char rcsId[] = "$Id$";
[_relativePathsCache setObject:GSNotFoundMarker [_relativePathsCache setObject:GSNotFoundMarker
forKeysArray:keys]; forKeysArray:keys];
}; };
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"lockedCachedRelativePathForResourceNamed:inDirectory:forLanguage:");
LOGException(@"%@ (%@)",localException,[localException reason]);
RETAIN(localException);
DESTROY(arp);
AUTORELEASE(localException);
[localException raise];
}
NS_ENDHANDLER;
RETAIN(path);
DESTROY(arp);
AUTORELEASE(path);
}; };
NSDebugMLLog(@"bundles",@"path=%@",path); NSDebugMLLog(@"bundles",@"path=%@",path);
LOGObjectFnStop(); LOGObjectFnStop();

View file

@ -93,7 +93,9 @@
NSMutableArray* _savedAllObjects; NSMutableArray* _savedAllObjects;
NSMutableDictionary* _queryMatch; NSMutableDictionary* _queryMatch;
NSMutableDictionary* _queryMin; NSMutableDictionary* _queryMin;
NSMutableDictionary* _queryMinMatch;
NSMutableDictionary*_queryMax; NSMutableDictionary*_queryMax;
NSMutableDictionary*_queryMaxMatch;
NSMutableDictionary*_queryOperator; NSMutableDictionary*_queryOperator;
NSString* _defaultStringMatchOperator; NSString* _defaultStringMatchOperator;
NSString* _defaultStringMatchFormat; NSString* _defaultStringMatchFormat;
@ -180,7 +182,9 @@
- (NSMutableDictionary*)queryBindings; - (NSMutableDictionary*)queryBindings;
- (NSMutableDictionary*)queryMatch; - (NSMutableDictionary*)queryMatch;
- (NSMutableDictionary*)queryMax; - (NSMutableDictionary*)queryMax;
- (NSMutableDictionary*)queryMaxMatch;
- (NSMutableDictionary*)queryMin; - (NSMutableDictionary*)queryMin;
- (NSMutableDictionary*)queryMinMatch;
- (NSMutableDictionary*)queryOperator; - (NSMutableDictionary*)queryOperator;
- (void)redisplay; - (void)redisplay;
- (NSArray *)relationalQualifierOperators; - (NSArray *)relationalQualifierOperators;

View file

@ -1,6 +1,6 @@
/** GSWDisplayGroup.m - <title>GSWeb: Class GSWDisplayGroup</title> /** GSWDisplayGroup.m - <title>GSWeb: Class GSWDisplayGroup</title>
Copyright (C) 1999-2002 Free Software Foundation, Inc. Copyright (C) 1999-2003 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Mirko Viviani <mirko.viviani@rccr.cremona.it> Mirko Viviani <mirko.viviani@rccr.cremona.it>
@ -29,9 +29,29 @@
</license> </license>
**/ **/
static const char rcsId[]="$Id$";
#include "GSWeb.h" #include "GSWeb.h"
@class EOUndoManager; @class EOUndoManager;
#if GDL2 // GDL2 implementation
//====================================================================
@interface GSWDisplayGroup (Private)
-(void)finishInitialization;
-(void)_setUpForNewDataSource;
-(void)_presentAlertWithTitle:(id)title
message:(id)msg;
-(void)_addQualifiersToArray:(NSMutableArray*)array
forValues:(NSDictionary*)values
operatorSelector:(SEL)sel;
-(EOQualifier*)_qualifierForKey:(id)key
value:(id)value
operatorSelector:(SEL)sel;
@end
#endif
//==================================================================== //====================================================================
@implementation GSWDisplayGroup @implementation GSWDisplayGroup
@ -50,7 +70,9 @@
_queryMatch = [[NSMutableDictionary alloc] initWithCapacity:8]; _queryMatch = [[NSMutableDictionary alloc] initWithCapacity:8];
_queryMin = [[NSMutableDictionary alloc] initWithCapacity:8]; _queryMin = [[NSMutableDictionary alloc] initWithCapacity:8];
_queryMinMatch = [[NSMutableDictionary alloc] initWithCapacity:8];
_queryMax = [[NSMutableDictionary alloc] initWithCapacity:8]; _queryMax = [[NSMutableDictionary alloc] initWithCapacity:8];
_queryMaxMatch = [[NSMutableDictionary alloc] initWithCapacity:8];
NSDebugMLLog(@"gswdisplaygroup",@"_queryOperator=%@",_queryOperator); NSDebugMLLog(@"gswdisplaygroup",@"_queryOperator=%@",_queryOperator);
_queryOperator = [[NSMutableDictionary alloc] initWithCapacity:8]; _queryOperator = [[NSMutableDictionary alloc] initWithCapacity:8];
NSDebugMLLog(@"gswdisplaygroup",@"_queryOperator=%@",_queryOperator); NSDebugMLLog(@"gswdisplaygroup",@"_queryOperator=%@",_queryOperator);
@ -173,8 +195,12 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
_queryMatch]; _queryMatch];
dscr=[dscr stringByAppendingFormat:@"queryMin:[%@]\n", dscr=[dscr stringByAppendingFormat:@"queryMin:[%@]\n",
_queryMin]; _queryMin];
dscr=[dscr stringByAppendingFormat:@"queryMin:[%@]\n",
_queryMinMatch];
dscr=[dscr stringByAppendingFormat:@"queryMax:[%@]\n", dscr=[dscr stringByAppendingFormat:@"queryMax:[%@]\n",
_queryMax]; _queryMax];
dscr=[dscr stringByAppendingFormat:@"queryMax:[%@]\n",
_queryMaxMatch];
dscr=[dscr stringByAppendingFormat:@"queryOperator:[%@]\n", dscr=[dscr stringByAppendingFormat:@"queryOperator:[%@]\n",
_queryOperator]; _queryOperator];
dscr=[dscr stringByAppendingFormat:@"defaultStringMatchOperator:[%@]\n", dscr=[dscr stringByAppendingFormat:@"defaultStringMatchOperator:[%@]\n",
@ -203,23 +229,6 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
}; };
-(void)finishInitialization
{
LOGObjectFnStart();
[self _setUpForNewDataSource];
//Finished ?
LOGObjectFnStop();
};
-(void)_setUpForNewDataSource
{
LOGObjectFnStart();
// call [_dataSource editingContext];
//Finished ?
LOGObjectFnStop();
};
-(void)encodeWithKeyValueArchiver:(id)object_ -(void)encodeWithKeyValueArchiver:(id)object_
{ {
LOGObjectFnStart(); LOGObjectFnStart();
@ -227,96 +236,6 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
LOGObjectFnStop(); LOGObjectFnStop();
}; };
-(void)_presentAlertWithTitle:(id)title
message:(id)msg
{
LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN
LOGObjectFnStop();
};
-(void)_addQualifiersToArray:(NSMutableArray*)array
forValues:(NSDictionary*)values
operatorSelector:(SEL)sel
{
//OK
NSEnumerator *enumerator=nil;
NSString *key=nil;
NSString *op=nil;
LOGObjectFnStart();
NSDebugMLLog(@"gswdisplaygroup",@"array=%@",array);
NSDebugMLLog(@"gswdisplaygroup",@"values=%@",values);
NSDebugMLLog(@"gswdisplaygroup",@"operatorSelector=%p: %@",
(void*)sel,
NSStringFromSelector(sel));
enumerator = [values keyEnumerator];
while((key = [enumerator nextObject]))
{
EOQualifier* qualifier=nil;
id value=[values objectForKey:key];
NSDebugMLLog(@"gswdisplaygroup",@"key=%@ value=%@",key,value);
qualifier=[self _qualifierForKey:key
value:value
operatorSelector:sel];
NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier);
if (qualifier)
[array addObject:qualifier];
};
NSDebugMLLog(@"gswdisplaygroup",@"array=%@",array);
LOGObjectFnStop();
};
-(EOQualifier*)_qualifierForKey:(id)key
value:(id)value
operatorSelector:(SEL)sel
{
//near OK (see VERIFY)
EOClassDescription* cd=nil;
EOQualifier* qualifier=nil;
NSException* validateException=nil;
LOGObjectFnStart();
NSDebugMLLog(@"gswdisplaygroup",@"value=%@",value);
NSDebugMLLog(@"gswdisplaygroup",@"operatorSelector=%p: %@",
(void*)sel,
NSStringFromSelector(sel));
cd=[_dataSource classDescriptionForObjects];// //ret [EOEntityClassDescription]: <EOEntityClassDescription: 0x1a3c7b0>
validateException=[cd validateValue:value
forKey:key];
NSDebugMLLog(@"gswdisplaygroup",@"validateException=%@",validateException);
if (validateException)
{
[validateException raise]; //VERIFY
}
else
{
NSString* op=nil;
NSString* fvalue=value;
//VERIFY!!
NSDebugMLLog(@"gswdisplaygroup",@"_queryOperator=%@",_queryOperator);
op = [_queryOperator objectForKey:key];
NSDebugMLLog(@"gswdisplaygroup",@"op=%@",op);
if(op)
sel = [EOQualifier operatorSelectorForString:op];
NSDebugMLLog(@"gswdisplaygroup",@"operatorSelector=%p: %@",
(void*)sel,
NSStringFromSelector(sel));
NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchFormat=%@",_defaultStringMatchFormat);
if (_defaultStringMatchFormat)
fvalue=[NSString stringWithFormat:_defaultStringMatchFormat,
value];//VERIFY !!!
NSDebugMLLog(@"gswdisplaygroup",@"fvalue=%@",fvalue);
qualifier=[[[EOKeyValueQualifier alloc]
initWithKey:key
operatorSelector:sel
value:fvalue] autorelease];
};
NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier);
return qualifier;
};
-(BOOL)_deleteObjectsAtIndexes:(id)indexes -(BOOL)_deleteObjectsAtIndexes:(id)indexes
{ {
LOGObjectFnStart(); LOGObjectFnStart();
@ -486,7 +405,9 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
DESTROY(_queryMatch); DESTROY(_queryMatch);
DESTROY(_queryMin); DESTROY(_queryMin);
DESTROY(_queryMinMatch);
DESTROY(_queryMax); DESTROY(_queryMax);
DESTROY(_queryMaxMatch);
DESTROY(_queryOperator); DESTROY(_queryOperator);
DESTROY(_defaultStringMatchOperator); DESTROY(_defaultStringMatchOperator);
@ -949,8 +870,23 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
{ {
NSArray *objects=nil; NSArray *objects=nil;
NSAutoreleasePool* arp = [NSAutoreleasePool new];
NS_DURING //for trace purpose
{
objects = [_dataSource fetchObjects]; objects = [_dataSource fetchObjects];
[self setObjectArray:objects];//OK [self setObjectArray:objects];//OK
}
NS_HANDLER
{
NSLog(@"%@ (%@)",localException,[localException reason]);
LOGException(@"%@ (%@)",localException,[localException reason]);
RETAIN(localException);
DESTROY(arp);
AUTORELEASE(localException);
[localException raise];
}
NS_ENDHANDLER;
DESTROY(arp);
[self _notify:@selector(displayGroup:didFetchObjects:) [self _notify:@selector(displayGroup:didFetchObjects:)
with:self with:self
with:_allObjects]; with:_allObjects];
@ -1244,6 +1180,14 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdisplaygroup",@"_queryMatch=%@", NSDebugMLLog(@"gswdisplaygroup",@"_queryMatch=%@",
_queryMatch); _queryMatch);
NSDebugMLLog(@"gswdisplaygroup",@"_queryMin=%@",
_queryMin);
NSDebugMLLog(@"gswdisplaygroup",@"_queryMax=%@",
_queryMax);
NSDebugMLLog(@"gswdisplaygroup",@"_queryMinMatch=%@",
_queryMinMatch);
NSDebugMLLog(@"gswdisplaygroup",@"_queryMaxMatch=%@",
_queryMaxMatch);
NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p", NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p",
_defaultStringMatchOperator, _defaultStringMatchOperator,
(void*)[EOQualifier operatorSelectorForString:_defaultStringMatchOperator]); (void*)[EOQualifier operatorSelectorForString:_defaultStringMatchOperator]);
@ -1252,10 +1196,16 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[self _addQualifiersToArray:array [self _addQualifiersToArray:array
forValues:_queryMax forValues:_queryMax
operatorSelector:EOQualifierOperatorLessThan];//LessThan ?? operatorSelector:EOQualifierOperatorLessThan];
[self _addQualifiersToArray:array
forValues:_queryMaxMatch
operatorSelector:EOQualifierOperatorLessThanOrEqualTo];
[self _addQualifiersToArray:array [self _addQualifiersToArray:array
forValues:_queryMin forValues:_queryMin
operatorSelector:EOQualifierOperatorGreaterThan];//GreaterThan ?? operatorSelector:EOQualifierOperatorGreaterThan];
[self _addQualifiersToArray:array
forValues:_queryMinMatch
operatorSelector:EOQualifierOperatorGreaterThanOrEqualTo];
NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p", NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p",
_defaultStringMatchOperator, _defaultStringMatchOperator,
@ -1347,6 +1297,14 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
return _queryMax; return _queryMax;
} }
//--------------------------------------------------------------------
// queryMaxMatch
- (NSMutableDictionary *)queryMaxMatch
{
return _queryMaxMatch;
}
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// queryMin // queryMin
@ -1355,6 +1313,14 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
return _queryMin; return _queryMin;
} }
//--------------------------------------------------------------------
// queryMinMatch
- (NSMutableDictionary *)queryMinMatch
{
return _queryMinMatch;
}
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// queryOperator // queryOperator
@ -2112,3 +2078,116 @@ STOP ?
#endif #endif
@end @end
#if GDL2 // GDL2 implementation
//====================================================================
@implementation GSWDisplayGroup (Private)
-(void)finishInitialization
{
LOGObjectFnStart();
[self _setUpForNewDataSource];
//Finished ?
LOGObjectFnStop();
};
-(void)_setUpForNewDataSource
{
LOGObjectFnStart();
// call [_dataSource editingContext];
//Finished ?
LOGObjectFnStop();
};
-(void)_presentAlertWithTitle:(id)title
message:(id)msg
{
LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN
LOGObjectFnStop();
};
-(void)_addQualifiersToArray:(NSMutableArray*)array
forValues:(NSDictionary*)values
operatorSelector:(SEL)sel
{
//OK
NSEnumerator *enumerator=nil;
NSString *key=nil;
LOGObjectFnStart();
NSDebugMLLog(@"gswdisplaygroup",@"array=%@",array);
NSDebugMLLog(@"gswdisplaygroup",@"values=%@",values);
NSDebugMLLog(@"gswdisplaygroup",@"operatorSelector=%p: %@",
(void*)sel,
NSStringFromSelector(sel));
enumerator = [values keyEnumerator];
while((key = [enumerator nextObject]))
{
EOQualifier* qualifier=nil;
id value=[values objectForKey:key];
NSDebugMLLog(@"gswdisplaygroup",@"key=%@ value=%@",key,value);
qualifier=[self _qualifierForKey:key
value:value
operatorSelector:sel];
NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier);
if (qualifier)
[array addObject:qualifier];
};
NSDebugMLLog(@"gswdisplaygroup",@"array=%@",array);
LOGObjectFnStop();
};
-(EOQualifier*)_qualifierForKey:(id)key
value:(id)value
operatorSelector:(SEL)sel
{
//near OK (see VERIFY)
EOClassDescription* cd=nil;
EOQualifier* qualifier=nil;
NSException* validateException=nil;
LOGObjectFnStart();
NSDebugMLLog(@"gswdisplaygroup",@"value=%@",value);
NSDebugMLLog(@"gswdisplaygroup",@"operatorSelector=%p: %@",
(void*)sel,
NSStringFromSelector(sel));
cd=[_dataSource classDescriptionForObjects];// //ret [EOEntityClassDescription]: <EOEntityClassDescription: 0x1a3c7b0>
validateException=[cd validateValue:value
forKey:key];
NSDebugMLLog(@"gswdisplaygroup",@"validateException=%@",validateException);
if (validateException)
{
[validateException raise]; //VERIFY
}
else
{
NSString* op=nil;
NSString* fvalue=value;
//VERIFY!!
NSDebugMLLog(@"gswdisplaygroup",@"_queryOperator=%@",_queryOperator);
op = [_queryOperator objectForKey:key];
NSDebugMLLog(@"gswdisplaygroup",@"op=%@",op);
if(op)
sel = [EOQualifier operatorSelectorForString:op];
NSDebugMLLog(@"gswdisplaygroup",@"operatorSelector=%p: %@",
(void*)sel,
NSStringFromSelector(sel));
NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchFormat=%@",_defaultStringMatchFormat);
if (_defaultStringMatchFormat)
fvalue=[NSString stringWithFormat:_defaultStringMatchFormat,
value];//VERIFY !!!
NSDebugMLLog(@"gswdisplaygroup",@"fvalue=%@",fvalue);
qualifier=[[[EOKeyValueQualifier alloc]
initWithKey:key
operatorSelector:sel
value:fvalue] autorelease];
};
NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier);
return qualifier;
};
@end
#endif

View file

@ -272,7 +272,7 @@ static const char rcsId[]="$Id$";
disabledValue=![self evaluateCondition:_enabled disabledValue=![self evaluateCondition:_enabled
inContext:context]; inContext:context];
if (!WOStrictFlag && _disabled && _displayDisabled) if (!WOStrictFlag && _displayDisabled)
{ {
displayDisabledValue=[self evaluateCondition:_displayDisabled displayDisabledValue=[self evaluateCondition:_displayDisabled
inContext:context]; inContext:context];

View file

@ -1387,19 +1387,20 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF
else else
{ {
GSMimeDocument* document = [parser mimeDocument]; GSMimeDocument* document = [parser mimeDocument];
NSArray* content=[document content]; NSArray* content=nil;
NSString* contentSubType=[document contentSubType]; NSString* contentSubtype=nil;
NSDebugMLog(@"document=%@",document); NSDebugMLog(@"document=%@",document);
content=[document content];
NSDebugMLog(@"contentType=%@",[document contentType]); NSDebugMLog(@"contentType=%@",[document contentType]);
NSDebugMLog(@"contentSubType=%@",[document contentSubType]); contentSubtype=[document contentSubtype];
NSDebugMLog(@"contentSubtype=%@",contentSubtype);
if ([contentSubType isEqual:@"form-data"]) if ([contentSubtype isEqual:@"form-data"])
{ {
NSDebugMLog(@"contentID=%@",[document contentID]); NSDebugMLog(@"contentID=%@",[document contentID]);
NSDebugMLog(@"[document allHeaders]=%@",[document allHeaders]); NSDebugMLog(@"[document allHeaders]=%@",[document allHeaders]);
NSDebugMLog(@"[document content]=%@",[document content]); NSDebugMLog(@"[document content]=%@",content);
NSDebugMLog(@"[document content] class=%@",[[document content] class]); NSDebugMLog(@"[document content] class=%@",[content class]);
NSDebugMLog(@"[document content]=%@",[document content]);
if (![content isKindOfClass:[NSArray class]]) if (![content isKindOfClass:[NSArray class]])
{ {
@ -1423,7 +1424,7 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF
aDocContent=[aDoc content]; aDocContent=[aDoc content];
NSDebugMLog(@"aDocContent=%@",aDocContent); NSDebugMLog(@"aDocContent=%@",aDocContent);
NSDebugMLog(@"contentType=%@",[aDoc contentType]); NSDebugMLog(@"contentType=%@",[aDoc contentType]);
NSDebugMLog(@"contentSubType=%@",[aDoc contentSubType]); NSDebugMLog(@"contentSubtype=%@",[aDoc contentSubtype]);
NSDebugMLog(@"contentID=%@",[aDoc contentID]); NSDebugMLog(@"contentID=%@",[aDoc contentID]);
contentDispositionHeader=[aDoc headerNamed:@"content-disposition"]; contentDispositionHeader=[aDoc headerNamed:@"content-disposition"];
NSDebugMLog(@"contentDispositionHeader=%@",contentDispositionHeader); NSDebugMLog(@"contentDispositionHeader=%@",contentDispositionHeader);

View file

@ -113,18 +113,18 @@ static const char rcsId[] = "$Id$";
GSWSession* session=nil; GSWSession* session=nil;
BOOL isSessionIDCheckedOut=NO; BOOL isSessionIDCheckedOut=NO;
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"sessions",@"aSessionID=%@",aSessionID);
NSDebugMLLog(@"sessions",@"_usedIDs=%@",_usedIDs);
isSessionIDCheckedOut=[self _isSessionIDCheckedOut:aSessionID]; isSessionIDCheckedOut=[self _isSessionIDCheckedOut:aSessionID];
if (isSessionIDCheckedOut) if (!isSessionIDCheckedOut)
{
return nil;//Used Session
}
else
{ {
NSDebugMLLog(@"sessions",@"_sessions=%@",_sessions);
session=[_sessions objectForKey:aSessionID]; session=[_sessions objectForKey:aSessionID];
NSDebugMLLog(@"sessions",@"session=%@",session); NSDebugMLLog(@"sessions",@"session=%@",session);
[session retain]; //to avoid discarding it now [session retain]; //to avoid discarding it now
[session autorelease]; //discard it 'later' [session autorelease]; //discard it 'later'
[_sessions removeObjectForKey:aSessionID]; [_sessions removeObjectForKey:aSessionID];
NSDebugMLLog(@"sessions",@"_sessions=%@",_sessions);
}; };
LOGObjectFnStop(); LOGObjectFnStop();
return session; return session;

View file

@ -44,6 +44,7 @@ static const char rcsId[]="$Id$";
_usedIDs=[NSMutableSet new]; _usedIDs=[NSMutableSet new];
_lock=[NSRecursiveLock new]; _lock=[NSRecursiveLock new];
_timeOutManager=[GSWSessionTimeOutManager new]; _timeOutManager=[GSWSessionTimeOutManager new];
NSDebugMLLog(@"sessions",@"GSWSessionStore self=%p class=%@",self,[self class]);
[_timeOutManager setCallBack:@selector(removeSessionWithID:) [_timeOutManager setCallBack:@selector(removeSessionWithID:)
target:self]; target:self];
[_timeOutManager startHandleTimerRefusingSessions]; [_timeOutManager startHandleTimerRefusingSessions];
@ -72,6 +73,7 @@ static const char rcsId[]="$Id$";
/** Abstract **/ /** Abstract **/
-(GSWSession*)removeSessionWithID:(NSString*)aSessionID -(GSWSession*)removeSessionWithID:(NSString*)aSessionID
{ {
NSDebugMLLog(@"sessions",@"self=%p class=%@",self,[self class]);
[self subclassResponsibility: _cmd]; [self subclassResponsibility: _cmd];
return nil; return nil;
}; };
@ -209,6 +211,7 @@ static const char rcsId[]="$Id$";
{ {
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In removeSessionWithID:"); @"In removeSessionWithID:");
NSLog(@"### exception ... %@", [localException reason]);
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
[localException raise]; [localException raise];
} }
@ -222,6 +225,7 @@ static const char rcsId[]="$Id$";
} }
NS_HANDLER NS_HANDLER
{ {
NSLog(@"### exception ... %@", [localException reason]);
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In saveSessionForContext:"); @"In saveSessionForContext:");
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
@ -304,6 +308,7 @@ static const char rcsId[]="$Id$";
{ {
LOGObjectFnStart(); LOGObjectFnStart();
[_usedIDs removeObject:aSessionID]; [_usedIDs removeObject:aSessionID];
NSDebugMLLog(@"sessions",@"_usedIDs=%@",_usedIDs);
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -324,6 +329,7 @@ static const char rcsId[]="$Id$";
else else
{ {
[_usedIDs addObject:aSessionID]; [_usedIDs addObject:aSessionID];
NSDebugMLLog(@"sessions",@"_usedIDs=%@",_usedIDs);
}; };
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -442,7 +448,14 @@ static const char rcsId[]="$Id$";
@implementation GSWSessionStore (GSWSessionStoreB) @implementation GSWSessionStore (GSWSessionStoreB)
-(void)_validateAPI -(void)_validateAPI
{ {
LOGObjectFnStart();
if ([self class]==[GSWSessionStore class])
{
[NSException raise:NSGenericException
format:@"Can't allocate a direct GSWSessionStore instance because some methods need to be implemented by subclasses"];
};
LOGObjectFnNotImplemented(); //TODOFN LOGObjectFnNotImplemented(); //TODOFN
LOGObjectFnStop();
}; };
@end @end

View file

@ -55,7 +55,9 @@
-(NSString*)sessionID; -(NSString*)sessionID;
-(void)setLastAccessTime:(NSTimeInterval)aTime; -(void)setLastAccessTime:(NSTimeInterval)aTime;
-(NSTimeInterval)lastAccessTime; -(NSTimeInterval)lastAccessTime;
-(NSDate*)lastAccessTimeDate;
-(NSTimeInterval)timeOutTime; -(NSTimeInterval)timeOutTime;
-(NSDate*)timeOutTimeDate;
@end @end

View file

@ -1,12 +1,13 @@
/** GSWSessionTimeOut.m - <title>GSWeb: Class GSWSessionTimeOut</title> /** GSWSessionTimeOut.m - <title>GSWeb: Class GSWSessionTimeOut</title>
Copyright (C) 1999-2002 Free Software Foundation, Inc. Copyright (C) 1999-2003 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999 Date: Mar 1999
$Revision$ $Revision$
$Date$ $Date$
$Id$
This file is part of the GNUstep Web Library. This file is part of the GNUstep Web Library.
@ -27,7 +28,7 @@
</license> </license>
**/ **/
static char rcsId[] = "$Id$"; static const char rcsId[] = "$Id$";
#include "GSWeb.h" #include "GSWeb.h"
#include "GSWSessionTimeOut.h" #include "GSWSessionTimeOut.h"
@ -45,6 +46,8 @@ static char rcsId[] = "$Id$";
ASSIGN(_sessionID,aSessionID); ASSIGN(_sessionID,aSessionID);
_lastAccessTime=aTime; _lastAccessTime=aTime;
_timeOut=aTimeOutInterval; _timeOut=aTimeOutInterval;
NSDebugMLog(@"_lastAccessTime=%f",_lastAccessTime);
NSDebugMLog(@"_timeOut=%f",_timeOut);
}; };
return self; return self;
}; };
@ -79,8 +82,8 @@ static char rcsId[] = "$Id$";
object_get_class_name(self), object_get_class_name(self),
(void*)self, (void*)self,
_sessionID, _sessionID,
[self timeOutTime], [self timeOutTimeDate],
_lastAccessTime, [self lastAccessTimeDate],
(long)_timeOut]; (long)_timeOut];
}; };
@ -110,6 +113,7 @@ static char rcsId[] = "$Id$";
-(void)setSessionTimeOut:(NSTimeInterval)aTimeOutInterval -(void)setSessionTimeOut:(NSTimeInterval)aTimeOutInterval
{ {
_timeOut=aTimeOutInterval; _timeOut=aTimeOutInterval;
NSDebugMLog(@"_timeOut=%f",_timeOut);
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -122,6 +126,7 @@ static char rcsId[] = "$Id$";
-(void)setLastAccessTime:(NSTimeInterval)aTime -(void)setLastAccessTime:(NSTimeInterval)aTime
{ {
_lastAccessTime=aTime; _lastAccessTime=aTime;
NSDebugMLog(@"_lastAccessTime=%f",_lastAccessTime);
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -130,11 +135,23 @@ static char rcsId[] = "$Id$";
return _lastAccessTime; return _lastAccessTime;
}; };
//--------------------------------------------------------------------
-(NSDate*)lastAccessTimeDate
{
return [NSDate dateWithTimeIntervalSinceReferenceDate:_lastAccessTime];
};
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(NSTimeInterval)timeOutTime -(NSTimeInterval)timeOutTime
{ {
return _lastAccessTime+_timeOut; return _lastAccessTime+_timeOut;
}; };
//--------------------------------------------------------------------
-(NSDate*)timeOutTimeDate
{
return [NSDate dateWithTimeIntervalSinceReferenceDate:_lastAccessTime+_timeOut];
};
@end @end

View file

@ -1,12 +1,13 @@
/** GSWSessionTimeOutManager.m - <title>GSWeb: Class GSWSessionTimeOutManager</title> /** GSWSessionTimeOutManager.m - <title>GSWeb: Class GSWSessionTimeOutManager</title>
Copyright (C) 1999-2002 Free Software Foundation, Inc. Copyright (C) 1999-2003 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999 Date: Mar 1999
$Revision$ $Revision$
$Date$ $Date$
$Id$
This file is part of the GNUstep Web Library. This file is part of the GNUstep Web Library.
@ -27,7 +28,7 @@
</license> </license>
**/ **/
static char rcsId[] = "$Id$"; static const char rcsId[] = "$Id$";
#include "GSWeb.h" #include "GSWeb.h"
#include "GSWSessionTimeOut.h" #include "GSWSessionTimeOut.h"
@ -40,6 +41,9 @@ static char rcsId[] = "$Id$";
if ((self=[super init])) if ((self=[super init]))
{ {
_sessionOrderedTimeOuts=[NSMutableArray new]; _sessionOrderedTimeOuts=[NSMutableArray new];
NSDebugMLLog(@"sessions",@"INIT self=%p",self);
NSDebugMLLog(@"sessions",@"self=%p _sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
_sessionTimeOuts=[NSMutableDictionary new]; _sessionTimeOuts=[NSMutableDictionary new];
// selfLock=[NSRecursiveLock new]; // selfLock=[NSRecursiveLock new];
_selfLock=[NSLock new]; _selfLock=[NSLock new];
@ -63,8 +67,11 @@ static char rcsId[] = "$Id$";
timeOut:(NSTimeInterval)timeOut timeOut:(NSTimeInterval)timeOut
{ {
//OK //OK
BOOL selfLocked=NO;
BOOL targetLocked=NO;
LOGObjectFnStart(); LOGObjectFnStart();
[self lock]; [self lock];
selfLocked=YES;
NS_DURING NS_DURING
{ {
NSTimer* timer=nil; NSTimer* timer=nil;
@ -72,7 +79,8 @@ static char rcsId[] = "$Id$";
NSDebugMLLog(@"sessions",@"timeOut=%ld",(long)timeOut); NSDebugMLLog(@"sessions",@"timeOut=%ld",(long)timeOut);
sessionTimeOut=[_sessionTimeOuts objectForKey:sessionID]; sessionTimeOut=[_sessionTimeOuts objectForKey:sessionID];
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut); NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut);
NSDebugMLLog(@"sessions",@"_sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p _sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
if (sessionTimeOut) if (sessionTimeOut)
{ {
[sessionTimeOut retain]; [sessionTimeOut retain];
@ -92,7 +100,8 @@ static char rcsId[] = "$Id$";
forKey:sessionID]; forKey:sessionID];
[_sessionOrderedTimeOuts addObject:sessionTimeOut]; [_sessionOrderedTimeOuts addObject:sessionTimeOut];
}; };
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut); NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut);
timer=[self resetTimer]; timer=[self resetTimer];
NSDebugMLLog(@"sessions",@"timer=%@",timer); NSDebugMLLog(@"sessions",@"timer=%@",timer);
@ -100,6 +109,7 @@ static char rcsId[] = "$Id$";
{ {
[GSWApplication logWithFormat:@"lock Target..."]; [GSWApplication logWithFormat:@"lock Target..."];
[_target lock]; [_target lock];
targetLocked=YES;
NS_DURING NS_DURING
{ {
[self addTimer:timer]; [self addTimer:timer];
@ -110,14 +120,26 @@ static char rcsId[] = "$Id$";
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
NSLog(@"### exception ... %@", [localException reason]); NSLog(@"### exception ... %@", [localException reason]);
//TODO //TODO
if (targetLocked)
{
[_target unlock]; [_target unlock];
targetLocked=NO;
};
if (selfLocked)
{
[self unlock]; [self unlock];
selfLocked=NO;
};
[localException raise]; [localException raise];
} }
NS_ENDHANDLER; NS_ENDHANDLER;
[GSWApplication logWithFormat:@"unlock Target..."]; [GSWApplication logWithFormat:@"unlock Target..."];
if (targetLocked)
{
[_target unlock]; [_target unlock];
targetLocked=NO;
};
}; };
} }
NS_HANDLER NS_HANDLER
@ -125,11 +147,19 @@ static char rcsId[] = "$Id$";
NSLog(@"### exception ... %@", [localException reason]); NSLog(@"### exception ... %@", [localException reason]);
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO //TODO
if (selfLocked)
{
[self unlock]; [self unlock];
selfLocked=NO;
};
[localException raise]; [localException raise];
} }
NS_ENDHANDLER; NS_ENDHANDLER;
if (selfLocked)
{
[self unlock]; [self unlock];
selfLocked=NO;
};
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -137,13 +167,18 @@ static char rcsId[] = "$Id$";
-(void)handleTimer:(id)aTimer -(void)handleTimer:(id)aTimer
{ {
//OK //OK
BOOL requestHandlingLocked=NO;
BOOL selfLocked=NO;
BOOL targetLocked=NO;
[GSWApplication statusLogWithFormat:@"Start HandleTimer"]; [GSWApplication statusLogWithFormat:@"Start HandleTimer"];
NSDebugMLog(@"Start HandleTimer"); NSDebugMLog(@"Start HandleTimer");
// LOGObjectFnStart(); // LOGObjectFnStart();
[GSWApp lockRequestHandling]; [GSWApp lockRequestHandling];
requestHandlingLocked=YES;
NS_DURING NS_DURING
{ {
[self lock]; [self lock];
selfLocked=YES;
NS_DURING NS_DURING
{ {
NSEnumerator *sessionTimeOutEnum = nil; NSEnumerator *sessionTimeOutEnum = nil;
@ -156,6 +191,10 @@ static char rcsId[] = "$Id$";
if ([sessionOrderedTimeOuts count]>0) if ([sessionOrderedTimeOuts count]>0)
_sessionTimeOut=[sessionOrderedTimeOuts objectAtIndex:0]; _sessionTimeOut=[sessionOrderedTimeOuts objectAtIndex:0];
*/ */
NSDebugMLLog(@"sessions",@"self=%p aTimer=%p",self,aTimer);
NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
NSDebugMLLog(@"sessions",@"now=%f",now);
sessionTimeOutEnum = [_sessionOrderedTimeOuts objectEnumerator]; sessionTimeOutEnum = [_sessionOrderedTimeOuts objectEnumerator];
@ -166,34 +205,46 @@ static char rcsId[] = "$Id$";
{ {
id session=nil; id session=nil;
[_target lock]; [_target lock];
targetLocked=YES;
NS_DURING NS_DURING
{ {
NSDebugMLLog(@"sessions",@"[sessionTimeOut sessionID]=%@",[sessionTimeOut sessionID]);
NSDebugMLLog(@"sessions",@"target [%@]=%@",[_target class],_target);
NSDebugMLLog(@"sessions",@"_callback=%@",NSStringFromSelector(_callback));
session=[_target performSelector:_callback session=[_target performSelector:_callback
withObject:[sessionTimeOut sessionID]]; withObject:[sessionTimeOut sessionID]];
NSDebugMLLog(@"sessions",@"session=%@",session); NSDebugMLLog(@"sessions",@"session=%@",session);
} }
NS_HANDLER NS_HANDLER
{ {
NSLog(@"### exception ... %@", [localException reason]);
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO //TODO
[_target unlock]; [_target unlock];
targetLocked=NO;
timer=[self resetTimer]; timer=[self resetTimer];
if (timer) if (timer)
[self addTimer:timer]; [self addTimer:timer];
[self unlock]; [self unlock];
selfLocked=NO;
[GSWApp unlockRequestHandling]; [GSWApp unlockRequestHandling];
requestHandlingLocked=NO;
[localException raise]; [localException raise];
} }
NS_ENDHANDLER; NS_ENDHANDLER;
[_target unlock]; [_target unlock];
targetLocked=NO;
NSDebugMLLog(@"sessions",@"session=%@",session);
if (session) if (session)
{ {
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
[session terminate]; [session terminate];
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", sessionTimeOut); NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", sessionTimeOut);
@ -201,7 +252,8 @@ static char rcsId[] = "$Id$";
[_sessionOrderedTimeOuts removeObject:sessionTimeOut]; [_sessionOrderedTimeOuts removeObject:sessionTimeOut];
[_sessionTimeOuts removeObjectForKey:[session sessionID]]; [_sessionTimeOuts removeObjectForKey:[session sessionID]];
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
removedNb++; removedNb++;
/* /*
if ([sessionOrderedTimeOuts count]>0) if ([sessionOrderedTimeOuts count]>0)
@ -223,23 +275,44 @@ static char rcsId[] = "$Id$";
{ {
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO //TODO
if (selfLocked)
{
[self unlock]; [self unlock];
selfLocked=NO;
};
if (requestHandlingLocked)
{
[GSWApp unlockRequestHandling]; [GSWApp unlockRequestHandling];
requestHandlingLocked=NO;
};
[localException raise]; [localException raise];
}; };
NS_ENDHANDLER; NS_ENDHANDLER;
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
if (selfLocked)
{
[self unlock]; [self unlock];
selfLocked=NO;
};
} }
NS_HANDLER NS_HANDLER
{ {
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO //TODO
if (requestHandlingLocked)
{
[GSWApp unlockRequestHandling]; [GSWApp unlockRequestHandling];
requestHandlingLocked=NO;
};
[localException raise]; [localException raise];
}; };
NS_ENDHANDLER; NS_ENDHANDLER;
if (requestHandlingLocked)
{
[GSWApp unlockRequestHandling]; [GSWApp unlockRequestHandling];
requestHandlingLocked=NO;
};
// LOGObjectFnStop(); // LOGObjectFnStop();
[GSWApplication statusLogWithFormat:@"Stop HandleTimer"]; [GSWApplication statusLogWithFormat:@"Stop HandleTimer"];
NSDebugMLog(@"Stop HandleTimer"); NSDebugMLog(@"Stop HandleTimer");
@ -257,7 +330,8 @@ static char rcsId[] = "$Id$";
NSTimeInterval now=[NSDate timeIntervalSinceReferenceDate]; NSTimeInterval now=[NSDate timeIntervalSinceReferenceDate];
NSTimeInterval timerFireTimeInterval=[[_timer fireDate]timeIntervalSinceReferenceDate]; NSTimeInterval timerFireTimeInterval=[[_timer fireDate]timeIntervalSinceReferenceDate];
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
if ([_sessionOrderedTimeOuts count]>0) if ([_sessionOrderedTimeOuts count]>0)
{ {
NSEnumerator* sessionOrderedTimeOutsEnum = [_sessionOrderedTimeOuts objectEnumerator]; NSEnumerator* sessionOrderedTimeOutsEnum = [_sessionOrderedTimeOuts objectEnumerator];
@ -312,6 +386,8 @@ static char rcsId[] = "$Id$";
[timer invalidate]; [timer invalidate];
*/ */
ASSIGN(_timer,newTimer); ASSIGN(_timer,newTimer);
NSDebugMLLog(@"sessions",@"old timer=%@",_timer);
NSDebugMLLog(@"sessions",@"new timer=%@",newTimer);
}; };
} }
else else
@ -319,6 +395,7 @@ static char rcsId[] = "$Id$";
} }
NS_HANDLER NS_HANDLER
{ {
NSLog(@"%@ (%@)",localException,[localException reason]);
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO //TODO
// [self unlock]; // [self unlock];
@ -351,8 +428,12 @@ static char rcsId[] = "$Id$";
target:(id)target target:(id)target
{ {
//OK //OK
LOGObjectFnStart();
NSDebugMLLog(@"sessions",@"target [%@]=%@",[target class],target);
NSDebugMLLog(@"sessions",@"callback=%@",NSStringFromSelector(callback));
_target=target; //Do not retain ! _target=target; //Do not retain !
_callback=callback; _callback=callback;
LOGObjectFnStop();
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -445,6 +526,9 @@ static char rcsId[] = "$Id$";
GSWApplication* ourApp = [GSWApplication application]; GSWApplication* ourApp = [GSWApplication application];
NSTimer *timer=nil; NSTimer *timer=nil;
NSDebugMLLog(@"sessions",@"aTimer=%p",aTimer);
NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
if (ourApp && [ourApp isRefusingNewSessions] && ([_sessionOrderedTimeOuts count] <= [ourApp minimumActiveSessionsCount])) if (ourApp && [ourApp isRefusingNewSessions] && ([_sessionOrderedTimeOuts count] <= [ourApp minimumActiveSessionsCount]))
{ {
// okay , soft-shutdown for all avtive sessions // okay , soft-shutdown for all avtive sessions
@ -460,12 +544,14 @@ static char rcsId[] = "$Id$";
[_target lock]; [_target lock];
NS_DURING NS_DURING
{ {
NSDebugMLLog(@"sessions",@"[sessionTimeOut sessionID]=%@",[sessionTimeOut sessionID]);
session=[_target performSelector:_callback session=[_target performSelector:_callback
withObject:[sessionTimeOut sessionID]]; withObject:[sessionTimeOut sessionID]];
NSDebugMLLog(@"sessions",@"session=%@",session); NSDebugMLLog(@"sessions",@"session=%@",session);
} }
NS_HANDLER NS_HANDLER
{ {
NSLog(@"### exception ... %@", [localException reason]);
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO //TODO
[_target unlock]; [_target unlock];
@ -484,16 +570,19 @@ static char rcsId[] = "$Id$";
if (session) if (session)
{ {
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
[session terminate]; // ??? [session terminate]; // ???
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", sessionTimeOut); NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", sessionTimeOut);
[_sessionOrderedTimeOuts removeObject:sessionTimeOut]; [_sessionOrderedTimeOuts removeObject:sessionTimeOut];
[_sessionTimeOuts removeObjectForKey:[session sessionID]]; [_sessionTimeOuts removeObjectForKey:[session sessionID]];
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
} }
} }
} }
@ -527,7 +616,8 @@ static char rcsId[] = "$Id$";
[localException raise]; [localException raise];
}; };
NS_ENDHANDLER; NS_ENDHANDLER;
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
[self unlock]; [self unlock];
} }
NS_HANDLER NS_HANDLER