diff --git a/ChangeLog b/ChangeLog index 3c8e730..0461ea5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2003-03-03 Manuel Guesdon + * 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 * GSWAdaptors/Apache/mod_gsweb.c (sendResponse): Add cast. diff --git a/GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd b/GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd index 80ef96e..131cefc 100644 --- a/GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd +++ b/GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd @@ -60,7 +60,7 @@ FileLinkWithPath: GSWHyperlink FileLinkWithURL: GSWHyperlink { - src=fileInfo.fileURL; + href=fileInfo.fileURL; string= ^string; target = ^target; }; diff --git a/GSWeb.framework/GSWApplication.m b/GSWeb.framework/GSWApplication.m index 1357270..025dbf1 100644 --- a/GSWeb.framework/GSWApplication.m +++ b/GSWeb.framework/GSWApplication.m @@ -1848,6 +1848,7 @@ selfLockn, //setSessionStore: -(void)setSessionStore:(GSWSessionStore*)sessionStore { + NSDebugMLog(@"sessionStore %@=%@",[sessionStore class],sessionStore); ASSIGN(_sessionStore,sessionStore); }; diff --git a/GSWeb.framework/GSWCheckBoxList.m b/GSWeb.framework/GSWCheckBoxList.m index f65d21e..822f42a 100644 --- a/GSWeb.framework/GSWCheckBoxList.m +++ b/GSWeb.framework/GSWCheckBoxList.m @@ -120,9 +120,9 @@ Bindings _selections = [[associations objectForKey:selections__Key withDefaultObject:[_selections autorelease]] retain]; 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) diff --git a/GSWeb.framework/GSWDeployedBundle.m b/GSWeb.framework/GSWDeployedBundle.m index 9ef85d8..772df47 100644 --- a/GSWeb.framework/GSWDeployedBundle.m +++ b/GSWeb.framework/GSWDeployedBundle.m @@ -294,7 +294,7 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName - forLanguages:(NSArray*)someLanguages + forLanguages:(NSArray*)someLanguages { //OK NSString* path=nil; @@ -365,58 +365,76 @@ static char rcsId[] = "$Id$"; NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",aName,aDirectory,aLanguage); if (aName) { - NSString* emptyString=[NSString string]; - NSString* bundlePath=[self bundlePath]; - NSArray* keys; - if ([aDirectory isEqualToString:@"."]) - aDirectory=nil; - if (aLanguage) - keys=[NSArray arrayWithObjects:aName, - bundlePath ? bundlePath : emptyString, - aDirectory ? aDirectory : emptyString, - aLanguage ? aLanguage : emptyString, - nil]; - else - keys=[NSArray arrayWithObjects:aName, - bundlePath ? bundlePath : emptyString, - aDirectory ? aDirectory : emptyString, - nil]; - //NSDebugMLLog(@"bundles",@"_keys=%@",_keys); - path=[_relativePathsCache objectForKeysArray:keys]; - //NSDebugMLLog(@"bundles",@"_path=%@",_path); - if (path==GSNotFoundMarker) - path=nil; - if (!path) + NSAutoreleasePool* arp = [NSAutoreleasePool new]; + NS_DURING { - //call again _relativePathForResourceNamed:inDirectory:forLanguage: - NSString* completePathTest=nil; - BOOL exists=NO; - NSFileManager* fileManager=nil; - NSString* pathTest=[NSString string]; - if (aDirectory) - pathTest=[pathTest stringByAppendingPathComponent:aDirectory]; - //NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest); + NSString* emptyString=[NSString string]; + NSString* bundlePath=[self bundlePath]; + NSArray* keys; + if ([aDirectory isEqualToString:@"."]) + aDirectory=nil; if (aLanguage) - pathTest=[pathTest stringByAppendingPathComponent: - [aLanguage stringByAppendingString:GSLanguagePSuffix]]; - //NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest); - pathTest=[pathTest stringByAppendingPathComponent:aName]; - NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest); - completePathTest=[bundlePath stringByAppendingPathComponent:pathTest]; - NSDebugMLLog(@"bundles",@"completePathTest=%@",completePathTest); - fileManager=[NSFileManager defaultManager]; - exists=[fileManager fileExistsAtPath:completePathTest]; - NSDebugMLLog(@"bundles",@"exists=%s",(exists ? "YES" : "NO")); - if (exists) - { - path=pathTest; - [_relativePathsCache setObject:path - forKeysArray:keys]; - } + keys=[NSArray arrayWithObjects:aName, + bundlePath ? bundlePath : emptyString, + aDirectory ? aDirectory : emptyString, + aLanguage ? aLanguage : emptyString, + nil]; else - [_relativePathsCache setObject:GSNotFoundMarker - forKeysArray:keys]; - }; + keys=[NSArray arrayWithObjects:aName, + bundlePath ? bundlePath : emptyString, + aDirectory ? aDirectory : emptyString, + nil]; + //NSDebugMLLog(@"bundles",@"_keys=%@",_keys); + path=[_relativePathsCache objectForKeysArray:keys]; + //NSDebugMLLog(@"bundles",@"_path=%@",_path); + if (path==GSNotFoundMarker) + path=nil; + if (!path) + { + //call again _relativePathForResourceNamed:inDirectory:forLanguage: + NSString* completePathTest=nil; + BOOL exists=NO; + NSFileManager* fileManager=nil; + NSString* pathTest=[NSString string]; + if (aDirectory) + pathTest=[pathTest stringByAppendingPathComponent:aDirectory]; + //NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest); + if (aLanguage) + pathTest=[pathTest stringByAppendingPathComponent: + [aLanguage stringByAppendingString:GSLanguagePSuffix]]; + //NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest); + pathTest=[pathTest stringByAppendingPathComponent:aName]; + NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest); + completePathTest=[bundlePath stringByAppendingPathComponent:pathTest]; + NSDebugMLLog(@"bundles",@"completePathTest=%@",completePathTest); + fileManager=[NSFileManager defaultManager]; + exists=[fileManager fileExistsAtPath:completePathTest]; + NSDebugMLLog(@"bundles",@"exists=%s",(exists ? "YES" : "NO")); + if (exists) + { + path=pathTest; + [_relativePathsCache setObject:path + forKeysArray:keys]; + } + else + [_relativePathsCache setObject:GSNotFoundMarker + 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); LOGObjectFnStop(); diff --git a/GSWeb.framework/GSWDisplayGroup.h b/GSWeb.framework/GSWDisplayGroup.h index effe0b1..98ff693 100644 --- a/GSWeb.framework/GSWDisplayGroup.h +++ b/GSWeb.framework/GSWDisplayGroup.h @@ -93,7 +93,9 @@ NSMutableArray* _savedAllObjects; NSMutableDictionary* _queryMatch; NSMutableDictionary* _queryMin; + NSMutableDictionary* _queryMinMatch; NSMutableDictionary*_queryMax; + NSMutableDictionary*_queryMaxMatch; NSMutableDictionary*_queryOperator; NSString* _defaultStringMatchOperator; NSString* _defaultStringMatchFormat; @@ -180,7 +182,9 @@ - (NSMutableDictionary*)queryBindings; - (NSMutableDictionary*)queryMatch; - (NSMutableDictionary*)queryMax; +- (NSMutableDictionary*)queryMaxMatch; - (NSMutableDictionary*)queryMin; +- (NSMutableDictionary*)queryMinMatch; - (NSMutableDictionary*)queryOperator; - (void)redisplay; - (NSArray *)relationalQualifierOperators; diff --git a/GSWeb.framework/GSWDisplayGroup.m b/GSWeb.framework/GSWDisplayGroup.m index a79dd19..4846b36 100644 --- a/GSWeb.framework/GSWDisplayGroup.m +++ b/GSWeb.framework/GSWDisplayGroup.m @@ -1,6 +1,6 @@ /** GSWDisplayGroup.m - GSWeb: Class GSWDisplayGroup - Copyright (C) 1999-2002 Free Software Foundation, Inc. + Copyright (C) 1999-2003 Free Software Foundation, Inc. Written by: Manuel Guesdon Mirko Viviani @@ -29,9 +29,29 @@ **/ +static const char rcsId[]="$Id$"; + #include "GSWeb.h" @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 @@ -50,7 +70,9 @@ _queryMatch = [[NSMutableDictionary alloc] initWithCapacity:8]; _queryMin = [[NSMutableDictionary alloc] initWithCapacity:8]; + _queryMinMatch = [[NSMutableDictionary alloc] initWithCapacity:8]; _queryMax = [[NSMutableDictionary alloc] initWithCapacity:8]; + _queryMaxMatch = [[NSMutableDictionary alloc] initWithCapacity:8]; NSDebugMLLog(@"gswdisplaygroup",@"_queryOperator=%@",_queryOperator); _queryOperator = [[NSMutableDictionary alloc] initWithCapacity:8]; NSDebugMLLog(@"gswdisplaygroup",@"_queryOperator=%@",_queryOperator); @@ -173,8 +195,12 @@ Description: _queryMatch]; dscr=[dscr stringByAppendingFormat:@"queryMin:[%@]\n", _queryMin]; + dscr=[dscr stringByAppendingFormat:@"queryMin:[%@]\n", + _queryMinMatch]; dscr=[dscr stringByAppendingFormat:@"queryMax:[%@]\n", _queryMax]; + dscr=[dscr stringByAppendingFormat:@"queryMax:[%@]\n", + _queryMaxMatch]; dscr=[dscr stringByAppendingFormat:@"queryOperator:[%@]\n", _queryOperator]; dscr=[dscr stringByAppendingFormat:@"defaultStringMatchOperator:[%@]\n", @@ -203,23 +229,6 @@ Description: }; --(void)finishInitialization -{ - LOGObjectFnStart(); - [self _setUpForNewDataSource]; - //Finished ? - - LOGObjectFnStop(); -}; - --(void)_setUpForNewDataSource -{ - LOGObjectFnStart(); - // call [_dataSource editingContext]; - //Finished ? - LOGObjectFnStop(); -}; - -(void)encodeWithKeyValueArchiver:(id)object_ { LOGObjectFnStart(); @@ -227,96 +236,6 @@ Description: 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]: - 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 { LOGObjectFnStart(); @@ -486,7 +405,9 @@ Description: DESTROY(_queryMatch); DESTROY(_queryMin); + DESTROY(_queryMinMatch); DESTROY(_queryMax); + DESTROY(_queryMaxMatch); DESTROY(_queryOperator); DESTROY(_defaultStringMatchOperator); @@ -949,8 +870,23 @@ Description: { NSArray *objects=nil; - objects = [_dataSource fetchObjects]; - [self setObjectArray:objects];//OK + NSAutoreleasePool* arp = [NSAutoreleasePool new]; + NS_DURING //for trace purpose + { + objects = [_dataSource fetchObjects]; + [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:) with:self with:_allObjects]; @@ -1244,6 +1180,14 @@ Description: LOGObjectFnStart(); NSDebugMLLog(@"gswdisplaygroup",@"_queryMatch=%@", _queryMatch); + NSDebugMLLog(@"gswdisplaygroup",@"_queryMin=%@", + _queryMin); + NSDebugMLLog(@"gswdisplaygroup",@"_queryMax=%@", + _queryMax); + NSDebugMLLog(@"gswdisplaygroup",@"_queryMinMatch=%@", + _queryMinMatch); + NSDebugMLLog(@"gswdisplaygroup",@"_queryMaxMatch=%@", + _queryMaxMatch); NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p", _defaultStringMatchOperator, (void*)[EOQualifier operatorSelectorForString:_defaultStringMatchOperator]); @@ -1252,10 +1196,16 @@ Description: [self _addQualifiersToArray:array forValues:_queryMax - operatorSelector:EOQualifierOperatorLessThan];//LessThan ?? + operatorSelector:EOQualifierOperatorLessThan]; + [self _addQualifiersToArray:array + forValues:_queryMaxMatch + operatorSelector:EOQualifierOperatorLessThanOrEqualTo]; [self _addQualifiersToArray:array forValues:_queryMin - operatorSelector:EOQualifierOperatorGreaterThan];//GreaterThan ?? + operatorSelector:EOQualifierOperatorGreaterThan]; + [self _addQualifiersToArray:array + forValues:_queryMinMatch + operatorSelector:EOQualifierOperatorGreaterThanOrEqualTo]; NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p", _defaultStringMatchOperator, @@ -1347,6 +1297,14 @@ Description: return _queryMax; } +//-------------------------------------------------------------------- +// queryMaxMatch + +- (NSMutableDictionary *)queryMaxMatch +{ + return _queryMaxMatch; +} + //-------------------------------------------------------------------- // queryMin @@ -1355,6 +1313,14 @@ Description: return _queryMin; } +//-------------------------------------------------------------------- +// queryMinMatch + +- (NSMutableDictionary *)queryMinMatch +{ + return _queryMinMatch; +} + //-------------------------------------------------------------------- // queryOperator @@ -2112,3 +2078,116 @@ STOP ? #endif @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]: + 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 diff --git a/GSWeb.framework/GSWHyperlink.m b/GSWeb.framework/GSWHyperlink.m index 5454290..28dfc12 100644 --- a/GSWeb.framework/GSWHyperlink.m +++ b/GSWeb.framework/GSWHyperlink.m @@ -272,7 +272,7 @@ static const char rcsId[]="$Id$"; disabledValue=![self evaluateCondition:_enabled inContext:context]; - if (!WOStrictFlag && _disabled && _displayDisabled) + if (!WOStrictFlag && _displayDisabled) { displayDisabledValue=[self evaluateCondition:_displayDisabled inContext:context]; diff --git a/GSWeb.framework/GSWRequest.m b/GSWeb.framework/GSWRequest.m index 3ec83c3..3d9eab7 100644 --- a/GSWeb.framework/GSWRequest.m +++ b/GSWeb.framework/GSWRequest.m @@ -1387,19 +1387,20 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF else { GSMimeDocument* document = [parser mimeDocument]; - NSArray* content=[document content]; - NSString* contentSubType=[document contentSubType]; + NSArray* content=nil; + NSString* contentSubtype=nil; NSDebugMLog(@"document=%@",document); + content=[document content]; 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(@"[document allHeaders]=%@",[document allHeaders]); - NSDebugMLog(@"[document content]=%@",[document content]); - NSDebugMLog(@"[document content] class=%@",[[document content] class]); - NSDebugMLog(@"[document content]=%@",[document content]); + NSDebugMLog(@"[document content]=%@",content); + NSDebugMLog(@"[document content] class=%@",[content class]); if (![content isKindOfClass:[NSArray class]]) { @@ -1423,7 +1424,7 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF aDocContent=[aDoc content]; NSDebugMLog(@"aDocContent=%@",aDocContent); NSDebugMLog(@"contentType=%@",[aDoc contentType]); - NSDebugMLog(@"contentSubType=%@",[aDoc contentSubType]); + NSDebugMLog(@"contentSubtype=%@",[aDoc contentSubtype]); NSDebugMLog(@"contentID=%@",[aDoc contentID]); contentDispositionHeader=[aDoc headerNamed:@"content-disposition"]; NSDebugMLog(@"contentDispositionHeader=%@",contentDispositionHeader); diff --git a/GSWeb.framework/GSWServerSessionStore.m b/GSWeb.framework/GSWServerSessionStore.m index 2cc0b17..7fd3d55 100644 --- a/GSWeb.framework/GSWServerSessionStore.m +++ b/GSWeb.framework/GSWServerSessionStore.m @@ -113,18 +113,18 @@ static const char rcsId[] = "$Id$"; GSWSession* session=nil; BOOL isSessionIDCheckedOut=NO; LOGObjectFnStart(); + NSDebugMLLog(@"sessions",@"aSessionID=%@",aSessionID); + NSDebugMLLog(@"sessions",@"_usedIDs=%@",_usedIDs); isSessionIDCheckedOut=[self _isSessionIDCheckedOut:aSessionID]; - if (isSessionIDCheckedOut) - { - return nil;//Used Session - } - else + if (!isSessionIDCheckedOut) { + NSDebugMLLog(@"sessions",@"_sessions=%@",_sessions); session=[_sessions objectForKey:aSessionID]; NSDebugMLLog(@"sessions",@"session=%@",session); [session retain]; //to avoid discarding it now [session autorelease]; //discard it 'later' [_sessions removeObjectForKey:aSessionID]; + NSDebugMLLog(@"sessions",@"_sessions=%@",_sessions); }; LOGObjectFnStop(); return session; diff --git a/GSWeb.framework/GSWSessionStore.m b/GSWeb.framework/GSWSessionStore.m index 1520628..3047b39 100644 --- a/GSWeb.framework/GSWSessionStore.m +++ b/GSWeb.framework/GSWSessionStore.m @@ -44,6 +44,7 @@ static const char rcsId[]="$Id$"; _usedIDs=[NSMutableSet new]; _lock=[NSRecursiveLock new]; _timeOutManager=[GSWSessionTimeOutManager new]; + NSDebugMLLog(@"sessions",@"GSWSessionStore self=%p class=%@",self,[self class]); [_timeOutManager setCallBack:@selector(removeSessionWithID:) target:self]; [_timeOutManager startHandleTimerRefusingSessions]; @@ -72,6 +73,7 @@ static const char rcsId[]="$Id$"; /** Abstract **/ -(GSWSession*)removeSessionWithID:(NSString*)aSessionID { + NSDebugMLLog(@"sessions",@"self=%p class=%@",self,[self class]); [self subclassResponsibility: _cmd]; return nil; }; @@ -209,6 +211,7 @@ static const char rcsId[]="$Id$"; { localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, @"In removeSessionWithID:"); + NSLog(@"### exception ... %@", [localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]); [localException raise]; } @@ -222,6 +225,7 @@ static const char rcsId[]="$Id$"; } NS_HANDLER { + NSLog(@"### exception ... %@", [localException reason]); localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, @"In saveSessionForContext:"); LOGException(@"%@ (%@)",localException,[localException reason]); @@ -304,6 +308,7 @@ static const char rcsId[]="$Id$"; { LOGObjectFnStart(); [_usedIDs removeObject:aSessionID]; + NSDebugMLLog(@"sessions",@"_usedIDs=%@",_usedIDs); LOGObjectFnStop(); }; @@ -324,6 +329,7 @@ static const char rcsId[]="$Id$"; else { [_usedIDs addObject:aSessionID]; + NSDebugMLLog(@"sessions",@"_usedIDs=%@",_usedIDs); }; LOGObjectFnStop(); }; @@ -442,7 +448,14 @@ static const char rcsId[]="$Id$"; @implementation GSWSessionStore (GSWSessionStoreB) -(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 + LOGObjectFnStop(); }; @end diff --git a/GSWeb.framework/GSWSessionTimeOut.h b/GSWeb.framework/GSWSessionTimeOut.h index c797821..c286cdf 100644 --- a/GSWeb.framework/GSWSessionTimeOut.h +++ b/GSWeb.framework/GSWSessionTimeOut.h @@ -55,7 +55,9 @@ -(NSString*)sessionID; -(void)setLastAccessTime:(NSTimeInterval)aTime; -(NSTimeInterval)lastAccessTime; +-(NSDate*)lastAccessTimeDate; -(NSTimeInterval)timeOutTime; +-(NSDate*)timeOutTimeDate; @end diff --git a/GSWeb.framework/GSWSessionTimeOut.m b/GSWeb.framework/GSWSessionTimeOut.m index 3bab382..3097b48 100644 --- a/GSWeb.framework/GSWSessionTimeOut.m +++ b/GSWeb.framework/GSWSessionTimeOut.m @@ -1,12 +1,13 @@ /** GSWSessionTimeOut.m - GSWeb: Class GSWSessionTimeOut - Copyright (C) 1999-2002 Free Software Foundation, Inc. + Copyright (C) 1999-2003 Free Software Foundation, Inc. Written by: Manuel Guesdon Date: Mar 1999 $Revision$ $Date$ + $Id$ This file is part of the GNUstep Web Library. @@ -27,7 +28,7 @@ **/ -static char rcsId[] = "$Id$"; +static const char rcsId[] = "$Id$"; #include "GSWeb.h" #include "GSWSessionTimeOut.h" @@ -45,6 +46,8 @@ static char rcsId[] = "$Id$"; ASSIGN(_sessionID,aSessionID); _lastAccessTime=aTime; _timeOut=aTimeOutInterval; + NSDebugMLog(@"_lastAccessTime=%f",_lastAccessTime); + NSDebugMLog(@"_timeOut=%f",_timeOut); }; return self; }; @@ -79,8 +82,8 @@ static char rcsId[] = "$Id$"; object_get_class_name(self), (void*)self, _sessionID, - [self timeOutTime], - _lastAccessTime, + [self timeOutTimeDate], + [self lastAccessTimeDate], (long)_timeOut]; }; @@ -110,6 +113,7 @@ static char rcsId[] = "$Id$"; -(void)setSessionTimeOut:(NSTimeInterval)aTimeOutInterval { _timeOut=aTimeOutInterval; + NSDebugMLog(@"_timeOut=%f",_timeOut); }; //-------------------------------------------------------------------- @@ -122,6 +126,7 @@ static char rcsId[] = "$Id$"; -(void)setLastAccessTime:(NSTimeInterval)aTime { _lastAccessTime=aTime; + NSDebugMLog(@"_lastAccessTime=%f",_lastAccessTime); }; //-------------------------------------------------------------------- @@ -130,11 +135,23 @@ static char rcsId[] = "$Id$"; return _lastAccessTime; }; +//-------------------------------------------------------------------- +-(NSDate*)lastAccessTimeDate +{ + return [NSDate dateWithTimeIntervalSinceReferenceDate:_lastAccessTime]; +}; + //-------------------------------------------------------------------- -(NSTimeInterval)timeOutTime { return _lastAccessTime+_timeOut; }; +//-------------------------------------------------------------------- +-(NSDate*)timeOutTimeDate +{ + return [NSDate dateWithTimeIntervalSinceReferenceDate:_lastAccessTime+_timeOut]; +}; + @end diff --git a/GSWeb.framework/GSWSessionTimeOutManager.m b/GSWeb.framework/GSWSessionTimeOutManager.m index 59cb9e5..af42fe5 100644 --- a/GSWeb.framework/GSWSessionTimeOutManager.m +++ b/GSWeb.framework/GSWSessionTimeOutManager.m @@ -1,12 +1,13 @@ /** GSWSessionTimeOutManager.m - GSWeb: Class GSWSessionTimeOutManager - Copyright (C) 1999-2002 Free Software Foundation, Inc. + Copyright (C) 1999-2003 Free Software Foundation, Inc. Written by: Manuel Guesdon - Date: Mar 1999 + Date: Mar 1999 $Revision$ $Date$ + $Id$ This file is part of the GNUstep Web Library. @@ -27,7 +28,7 @@ **/ -static char rcsId[] = "$Id$"; +static const char rcsId[] = "$Id$"; #include "GSWeb.h" #include "GSWSessionTimeOut.h" @@ -40,10 +41,13 @@ static char rcsId[] = "$Id$"; if ((self=[super init])) { _sessionOrderedTimeOuts=[NSMutableArray new]; + NSDebugMLLog(@"sessions",@"INIT self=%p",self); + NSDebugMLLog(@"sessions",@"self=%p _sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); _sessionTimeOuts=[NSMutableDictionary new]; // selfLock=[NSRecursiveLock new]; _selfLock=[NSLock new]; - }; + }; return self; }; @@ -63,8 +67,11 @@ static char rcsId[] = "$Id$"; timeOut:(NSTimeInterval)timeOut { //OK + BOOL selfLocked=NO; + BOOL targetLocked=NO; LOGObjectFnStart(); [self lock]; + selfLocked=YES; NS_DURING { NSTimer* timer=nil; @@ -72,7 +79,8 @@ static char rcsId[] = "$Id$"; NSDebugMLLog(@"sessions",@"timeOut=%ld",(long)timeOut); sessionTimeOut=[_sessionTimeOuts objectForKey:sessionID]; NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut); - NSDebugMLLog(@"sessions",@"_sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); + NSDebugMLLog(@"sessions",@"self=%p _sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); if (sessionTimeOut) { [sessionTimeOut retain]; @@ -92,7 +100,8 @@ static char rcsId[] = "$Id$"; forKey:sessionID]; [_sessionOrderedTimeOuts addObject:sessionTimeOut]; }; - NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); + NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut); timer=[self resetTimer]; NSDebugMLLog(@"sessions",@"timer=%@",timer); @@ -100,6 +109,7 @@ static char rcsId[] = "$Id$"; { [GSWApplication logWithFormat:@"lock Target..."]; [_target lock]; + targetLocked=YES; NS_DURING { [self addTimer:timer]; @@ -110,14 +120,26 @@ static char rcsId[] = "$Id$"; LOGException(@"%@ (%@)",localException,[localException reason]); NSLog(@"### exception ... %@", [localException reason]); //TODO - [_target unlock]; - [self unlock]; + if (targetLocked) + { + [_target unlock]; + targetLocked=NO; + }; + if (selfLocked) + { + [self unlock]; + selfLocked=NO; + }; [localException raise]; } NS_ENDHANDLER; [GSWApplication logWithFormat:@"unlock Target..."]; - [_target unlock]; + if (targetLocked) + { + [_target unlock]; + targetLocked=NO; + }; }; } NS_HANDLER @@ -125,11 +147,19 @@ static char rcsId[] = "$Id$"; NSLog(@"### exception ... %@", [localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]); //TODO - [self unlock]; + if (selfLocked) + { + [self unlock]; + selfLocked=NO; + }; [localException raise]; } NS_ENDHANDLER; - [self unlock]; + if (selfLocked) + { + [self unlock]; + selfLocked=NO; + }; LOGObjectFnStop(); }; @@ -137,13 +167,18 @@ static char rcsId[] = "$Id$"; -(void)handleTimer:(id)aTimer { //OK + BOOL requestHandlingLocked=NO; + BOOL selfLocked=NO; + BOOL targetLocked=NO; [GSWApplication statusLogWithFormat:@"Start HandleTimer"]; NSDebugMLog(@"Start HandleTimer"); // LOGObjectFnStart(); [GSWApp lockRequestHandling]; + requestHandlingLocked=YES; NS_DURING { [self lock]; + selfLocked=YES; NS_DURING { NSEnumerator *sessionTimeOutEnum = nil; @@ -156,6 +191,10 @@ static char rcsId[] = "$Id$"; if ([sessionOrderedTimeOuts count]>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]; @@ -166,34 +205,46 @@ static char rcsId[] = "$Id$"; { id session=nil; [_target lock]; + targetLocked=YES; NS_DURING { + NSDebugMLLog(@"sessions",@"[sessionTimeOut sessionID]=%@",[sessionTimeOut sessionID]); + NSDebugMLLog(@"sessions",@"target [%@]=%@",[_target class],_target); + NSDebugMLLog(@"sessions",@"_callback=%@",NSStringFromSelector(_callback)); session=[_target performSelector:_callback withObject:[sessionTimeOut sessionID]]; NSDebugMLLog(@"sessions",@"session=%@",session); } NS_HANDLER { + NSLog(@"### exception ... %@", [localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]); - //TODO + //TODO [_target unlock]; + targetLocked=NO; timer=[self resetTimer]; if (timer) [self addTimer:timer]; [self unlock]; + selfLocked=NO; [GSWApp unlockRequestHandling]; + requestHandlingLocked=NO; [localException raise]; } NS_ENDHANDLER; [_target unlock]; + targetLocked=NO; + NSDebugMLLog(@"sessions",@"session=%@",session); if (session) { - NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); + NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); [session terminate]; - NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); + NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", sessionTimeOut); @@ -201,7 +252,8 @@ static char rcsId[] = "$Id$"; [_sessionOrderedTimeOuts removeObject:sessionTimeOut]; [_sessionTimeOuts removeObjectForKey:[session sessionID]]; - NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); + NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); removedNb++; /* if ([sessionOrderedTimeOuts count]>0) @@ -223,24 +275,45 @@ static char rcsId[] = "$Id$"; { LOGException(@"%@ (%@)",localException,[localException reason]); //TODO - [self unlock]; - [GSWApp unlockRequestHandling]; + if (selfLocked) + { + [self unlock]; + selfLocked=NO; + }; + if (requestHandlingLocked) + { + [GSWApp unlockRequestHandling]; + requestHandlingLocked=NO; + }; [localException raise]; }; NS_ENDHANDLER; - NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); - [self unlock]; + NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); + if (selfLocked) + { + [self unlock]; + selfLocked=NO; + }; } NS_HANDLER { LOGException(@"%@ (%@)",localException,[localException reason]); //TODO - [GSWApp unlockRequestHandling]; + if (requestHandlingLocked) + { + [GSWApp unlockRequestHandling]; + requestHandlingLocked=NO; + }; [localException raise]; }; NS_ENDHANDLER; - [GSWApp unlockRequestHandling]; -// LOGObjectFnStop(); + if (requestHandlingLocked) + { + [GSWApp unlockRequestHandling]; + requestHandlingLocked=NO; + }; + // LOGObjectFnStop(); [GSWApplication statusLogWithFormat:@"Stop HandleTimer"]; NSDebugMLog(@"Stop HandleTimer"); }; @@ -257,7 +330,8 @@ static char rcsId[] = "$Id$"; NSTimeInterval now=[NSDate timeIntervalSinceReferenceDate]; NSTimeInterval timerFireTimeInterval=[[_timer fireDate]timeIntervalSinceReferenceDate]; - NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); + NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); if ([_sessionOrderedTimeOuts count]>0) { NSEnumerator* sessionOrderedTimeOutsEnum = [_sessionOrderedTimeOuts objectEnumerator]; @@ -312,6 +386,8 @@ static char rcsId[] = "$Id$"; [timer invalidate]; */ ASSIGN(_timer,newTimer); + NSDebugMLLog(@"sessions",@"old timer=%@",_timer); + NSDebugMLLog(@"sessions",@"new timer=%@",newTimer); }; } else @@ -319,6 +395,7 @@ static char rcsId[] = "$Id$"; } NS_HANDLER { + NSLog(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]); //TODO // [self unlock]; @@ -351,8 +428,12 @@ static char rcsId[] = "$Id$"; target:(id)target { //OK + LOGObjectFnStart(); + NSDebugMLLog(@"sessions",@"target [%@]=%@",[target class],target); + NSDebugMLLog(@"sessions",@"callback=%@",NSStringFromSelector(callback)); _target=target; //Do not retain ! _callback=callback; + LOGObjectFnStop(); }; //-------------------------------------------------------------------- @@ -445,6 +526,9 @@ static char rcsId[] = "$Id$"; GSWApplication* ourApp = [GSWApplication application]; 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])) { // okay , soft-shutdown for all avtive sessions @@ -460,12 +544,14 @@ static char rcsId[] = "$Id$"; [_target lock]; NS_DURING { + NSDebugMLLog(@"sessions",@"[sessionTimeOut sessionID]=%@",[sessionTimeOut sessionID]); session=[_target performSelector:_callback withObject:[sessionTimeOut sessionID]]; NSDebugMLLog(@"sessions",@"session=%@",session); } NS_HANDLER { + NSLog(@"### exception ... %@", [localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]); //TODO [_target unlock]; @@ -484,16 +570,19 @@ static char rcsId[] = "$Id$"; if (session) { - NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); + NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); [session terminate]; // ??? - NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); + NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", sessionTimeOut); [_sessionOrderedTimeOuts removeObject:sessionTimeOut]; [_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]; }; NS_ENDHANDLER; - NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts); + NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@", + self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts); [self unlock]; } NS_HANDLER