* GSWeb.framework/GSWApplication.m

(GSWApplicationMainReal): Reformat.  Use GSCurrentThread
        instead of objc_thread_id. Remove \n in NSLog type logs.
        (GSWApplicationMain): Ditto.
        ([GSWApplication init], [GSWApplication lockRequestHandling],
        [GSWApplication unlockRequestHandling], [GSWApplication lock],
        [GSWApplication unlock], [GSWApplication _sessionClass],
        [GSWApplication run],
        [GSWApplication addDynCreateClassName:superClassName:],
        [GSWApplication pageWithName:],
        [GSWApplication dynamicElementWithName:associations:template:]):
        Ditto.
        * GSWeb.framework/GSWComponent.m
        ([GSWComponent appendToResponse:inContext:], [GSWComponent
        templateWithHTMLString:declarationString:languages:]): Ditto.
        * GSWeb.framework/GSWContext.m
        ([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
        * GSWeb.framework/GSWDebug.m
        (GSWLogC_, GSWLogDumpObjectFn): Ditto.
        * GSWeb.framework/GSWDefaultAdaptor.m
        ([GSWDefaultAdaptor registerForEvents],
        [GSWDefaultAdaptor announceNewConnection:],
        [GSWDefaultAdaptor adaptorThreadExited:],
        [GSWDefaultAdaptor tryLock]): Ditto.
        * GSWeb.framework/GSWDefaultAdaptorThread.m
        ([GSWDefaultAdaptorThread setPool:destroyLast:],
        [GSWDefaultAdaptorThread run:],
        [GSWDefaultAdaptorThread threadExited],
        [GSWDefaultAdaptorThread isExpired],
        [GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
        [GSWDefaultAdaptorThread
        sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
        * GSWeb.framework/GSWDeployedBundle.m
        ([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
        [GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
        * GSWeb.framework/GSWLifebeatThread.m
        ([GSWLifebeatThread setPool:destroyLast:],
        [GSWLifebeatThread threadExited]): Ditto.
        * GSWeb.framework/GSWSession.m
        ([GSWSession initWithCoder:],
        [GSWSession _releaseAutoreleasePool]): Ditto.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18611 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ayers 2004-02-17 16:53:36 +00:00
parent c62d15ffe2
commit 8c0a3efa9f
10 changed files with 326 additions and 232 deletions

View file

@ -1,3 +1,47 @@
2004-02-17 David Ayers <d.ayers@inode.at>
* GSWeb.framework/GSWApplication.m
(GSWApplicationMainReal): Reformat. Use GSCurrentThread instead
of objc_thread_id. Remove \n in NSLog type logs.
(GSWApplicationMain): Ditto.
([GSWApplication init], [GSWApplication lockRequestHandling],
[GSWApplication unlockRequestHandling], [GSWApplication lock],
[GSWApplication unlock], [GSWApplication _sessionClass],
[GSWApplication run],
[GSWApplication addDynCreateClassName:superClassName:],
[GSWApplication pageWithName:],
[GSWApplication dynamicElementWithName:associations:template:]):
Ditto.
* GSWeb.framework/GSWComponent.m
([GSWComponent appendToResponse:inContext:], [GSWComponent
templateWithHTMLString:declarationString:languages:]): Ditto.
* GSWeb.framework/GSWContext.m
([GSWContext dealloc], [GSWContext setValidate:]): Ditto.
* GSWeb.framework/GSWDebug.m
(GSWLogC_, GSWLogDumpObjectFn): Ditto.
* GSWeb.framework/GSWDefaultAdaptor.m
([GSWDefaultAdaptor registerForEvents],
[GSWDefaultAdaptor announceNewConnection:],
[GSWDefaultAdaptor adaptorThreadExited:],
[GSWDefaultAdaptor tryLock]): Ditto.
* GSWeb.framework/GSWDefaultAdaptorThread.m
([GSWDefaultAdaptorThread setPool:destroyLast:],
[GSWDefaultAdaptorThread run:],
[GSWDefaultAdaptorThread threadExited],
[GSWDefaultAdaptorThread isExpired],
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:],
[GSWDefaultAdaptorThread
sendConnectionRefusedResponseToStream:withMessage:]): Ditto.
* GSWeb.framework/GSWDeployedBundle.m
([GSWDeployedBundle initWithPath:], [GSWDeployedBundle dealloc],
[GSWDeployedBundle lock], [GSWDeployedBundle unlock]): Ditto.
* GSWeb.framework/GSWLifebeatThread.m
([GSWLifebeatThread setPool:destroyLast:],
[GSWLifebeatThread threadExited]): Ditto.
* GSWeb.framework/GSWSession.m
([GSWSession initWithCoder:],
[GSWSession _releaseAutoreleasePool]): Ditto.
2004-02-16 David Ayers <d.ayers@inode.at> 2004-02-16 David Ayers <d.ayers@inode.at>
* GSWeb.framework/GSWUtils.h/m * GSWeb.framework/GSWUtils.h/m

View file

@ -652,7 +652,8 @@ int GSWApplicationMainReal(NSString* applicationClassName,
// Make sure we pass all exceptions back to the requestor. // Make sure we pass all exceptions back to the requestor.
NS_HANDLER NS_HANDLER
{ {
NSLog(@"Can't create Application (Class:%@)- %@ %@ Name:%@ Reason:%@\n", NSLog(@"Can't create Application (Class:%@)- "
@"%@ %@ Name:%@ Reason:%@",
applicationClass, applicationClass,
localException, localException,
[localException description], [localException description],
@ -739,7 +740,8 @@ int GSWApplicationMain(NSString* applicationClassName,
ASSIGN(_lastAccessDate,[NSDate date]); ASSIGN(_lastAccessDate,[NSDate date]);
[self setTimeOut:0];//No time out [self setTimeOut:0];//No time out
NSDebugMLLog(@"application",@"GSCurrentThreadDictionary()=%@",GSCurrentThreadDictionary()); NSDebugMLLog(@"application",@"GSCurrentThreadDictionary()=%@",
GSCurrentThreadDictionary());
//Do it before run so application can addTimer,... in -run //Do it before run so application can addTimer,... in -run
NSDebugMLLog(@"application",@"[NSRunLoop currentRunLoop]=%@",[NSRunLoop currentRunLoop]); NSDebugMLLog(@"application",@"[NSRunLoop currentRunLoop]=%@",[NSRunLoop currentRunLoop]);
@ -954,13 +956,15 @@ int GSWApplicationMain(NSString* applicationClassName,
LOGObjectFnStart(); LOGObjectFnStart();
if (![self isConcurrentRequestHandlingEnabled]) if (![self isConcurrentRequestHandlingEnabled])
{ {
/* NSDebugMLLog(@"application",@"globalLockn=%d globalLock_thread_id=%p objc_thread_id()=%p", /* NSDebugMLLog(@"application",
@"globalLockn=%d globalLock_thread_id=%@ "
@"GSCurrentThread()=%@",
globalLockn,(void*) globalLockn,(void*)
globalLock_thread_id, globalLock_thread_id,
(void*)objc_thread_id()); GSCurrentThread());
if (globalLockn>0) if (globalLockn>0)
{ {
if (globalLock_thread_id!=objc_thread_id()) if (globalLock_thread_id!=GSCurrentThread())
{ {
NSDebugMLLog(@"application",@"PROBLEM: owner!=thread id"); NSDebugMLLog(@"application",@"PROBLEM: owner!=thread id");
}; };
@ -968,17 +972,18 @@ int GSWApplicationMain(NSString* applicationClassName,
*/ */
NS_DURING NS_DURING
{ {
NSDebugLockMLog(@"GLOBALLOCK lock ThreadID=%p\n",(void*)objc_thread_id()); NSDebugLockMLog(@"GLOBALLOCK lock %@", GSCurrentThread());
LoggedLockBeforeDate(_globalLock,GSW_LOCK_LIMIT); LoggedLockBeforeDate(_globalLock,GSW_LOCK_LIMIT);
NSDebugLockMLog(@"GLOBALLOCK locked ThreadID=%p\n",(void*)objc_thread_id()); NSDebugLockMLog(@"GLOBALLOCK locked %@", GSCurrentThread());
#ifndef NDEBUG #ifndef NDEBUG
_globalLockn++; _globalLockn++;
_globalLock_thread_id=objc_thread_id(); _globalLock_thread_id=GSCurrentThread();
#endif #endif
/* NSDebugMLLog(@"application",@"globalLockn=%d globalLock_thread_id=%p objc_thread_id()=%p", /* NSDebugMLLog(@"application",
globalLockn, @"globalLockn=%d globalLock_thread_id=%@ GSCurrentThread()=%@",
(void*)globalLock_thread_id, globalLockn,
(void*)objc_thread_id());*/ globalLock_thread_id,
GSCurrentThread());*/
} }
NS_HANDLER NS_HANDLER
{ {
@ -1002,36 +1007,39 @@ int GSWApplicationMain(NSString* applicationClassName,
{ {
NS_DURING NS_DURING
{ {
/* NSDebugMLLog(@"application",@"globalLockn=%d globalLock_thread_id=%p objc_thread_id()=%p", /* NSDebugMLLog(@"application",
@"globalLockn=%d globalLock_thread_id=%@ GSCurrentThread()=%@",
globalLockn, globalLockn,
(void*)globalLock_thread_id, globalLock_thread_id,
(void*)objc_thread_id());*/ GSCurrentThread());*/
if (_globalLockn>0) if (_globalLockn>0)
{ {
if (_globalLock_thread_id!=objc_thread_id()) if (_globalLock_thread_id!=GSCurrentThread())
{ {
NSDebugMLLog0(@"application",@"PROBLEM: owner!=thread id"); NSDebugMLLog0(@"application",@"PROBLEM: owner!=thread id");
}; };
}; };
NSDebugLockMLog(@"GLOBALLOCK unlock ThreadID=%p\n",(void*)objc_thread_id()); NSDebugLockMLog(@"GLOBALLOCK unlock %@", GSCurrentThread());
LoggedUnlock(_globalLock); LoggedUnlock(_globalLock);
NSDebugLockMLog(@"GLOBALLOCK unlocked ThreadID=%p\n",(void*)objc_thread_id()); NSDebugLockMLog(@"GLOBALLOCK unlocked %@",GSCurrentThread());
#ifndef NDEBUG #ifndef NDEBUG
_globalLockn--; _globalLockn--;
if (_globalLockn==0) if (_globalLockn==0)
_globalLock_thread_id=NULL; _globalLock_thread_id=NULL;
#endif #endif
/* NSDebugMLLog(@"application",@"globalLockn=%d globalLock_thread_id=%p objc_thread_id()=%p", /* NSDebugMLLog(@"application",
globalLockn, @"globalLockn=%d globalLock_thread_id=%@ GSCurrentThread()=%@",
(void*)globalLock_thread_id, globalLockn,
(void*)objc_thread_id());*/ globalLock_thread_id,
GSCurrentThread());*/
} }
NS_HANDLER NS_HANDLER
{ {
NSDebugMLog(@"globalLockn=%d globalLock_thread_id=%p objc_thread_id()=%p", NSDebugMLog(@"globalLockn=%d globalLock_thread_id=%@ "
@"GSCurrentThread()=%@",
_globalLockn, _globalLockn,
(void*)_globalLock_thread_id, _globalLock_thread_id,
(void*)objc_thread_id()); GSCurrentThread());
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"globalLock loggedunlock"); @"globalLock loggedunlock");
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
@ -1049,13 +1057,14 @@ int GSWApplicationMain(NSString* applicationClassName,
//call adaptorsDispatchRequestsConcurrently //call adaptorsDispatchRequestsConcurrently
//OK //OK
LOGObjectFnStart(); LOGObjectFnStart();
/* NSDebugMLLog(@"application",@"selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p", /* NSDebugMLLog(@"application",@"selfLockn=%d selfLock_thread_id=%@ "
@"GSCurrentThread()=%@",
selfLockn, selfLockn,
(void*)selfLock_thread_id, selfLock_thread_id,
(void*)objc_thread_id()); GSCurrentThread());
if (selfLockn>0) if (selfLockn>0)
{ {
if (selfLock_thread_id!=objc_thread_id()) if (selfLock_thread_id!=GSCurrentThread())
{ {
NSDebugMLLog(@"application",@"PROBLEM: owner!=thread id"); NSDebugMLLog(@"application",@"PROBLEM: owner!=thread id");
}; };
@ -1063,22 +1072,23 @@ int GSWApplicationMain(NSString* applicationClassName,
*/ */
NS_DURING NS_DURING
{ {
/* printf("SELFLOCK lock ThreadID=%p\n",(void*)objc_thread_id()); /* printf("SELFLOCK lock %@\n", GSCurrentThread());
LoggedLockBeforeDate(selfLock,GSW_LOCK_LIMIT); LoggedLockBeforeDate(selfLock,GSW_LOCK_LIMIT);
printf("SELFLOCK locked ThreadID=%p\n",(void*)objc_thread_id()); printf("SELFLOCK locked %@\n", GSCurrentThread());
#ifndef NDEBUG #ifndef NDEBUG
selfLockn++; selfLockn++;
selfLock_thread_id=objc_thread_id(); selfLock_thread_id=GSCurrentThread();
#endif #endif
NSDebugMLLog(@"application",@"selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p", NSDebugMLLog(@"application",
selfLockn, @"selfLockn=%d selfLock_thread_id=%@ GSCurrentThread()=%@",
(void*)selfLock_thread_id, selfLockn,
(void*)objc_thread_id()); selfLock_thread_id,
GSCurrentThread());
*/ */
[_selfLock lock];//NEW [_selfLock lock];//NEW
#ifndef NDEBUG #ifndef NDEBUG
_selfLockn++; _selfLockn++;
_selfLock_thread_id=objc_thread_id(); _selfLock_thread_id=GSCurrentThread();
#endif #endif
} }
NS_HANDLER NS_HANDLER
@ -1099,13 +1109,14 @@ selfLockn,
//call adaptorsDispatchRequestsConcurrently //call adaptorsDispatchRequestsConcurrently
//OK //OK
LOGObjectFnStart(); LOGObjectFnStart();
/* NSDebugMLLog(@"application",@"selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p", /* NSDebugMLLog(@"application",
@"selfLockn=%d selfLock_thread_id=%@ GSCurrentThread()=%@",
selfLockn, selfLockn,
(void*)selfLock_thread_id, selfLock_thread_id,
(void*)objc_thread_id()); GSCurrentThread());
if (selfLockn>0) if (selfLockn>0)
{ {
if (selfLock_thread_id!=objc_thread_id()) if (selfLock_thread_id!=GSCurrentThread())
{ {
NSDebugMLLog(@"application",@"PROBLEM: owner!=thread id"); NSDebugMLLog(@"application",@"PROBLEM: owner!=thread id");
}; };
@ -1113,27 +1124,29 @@ selfLockn,
*/ */
NS_DURING NS_DURING
{ {
NSDebugLockMLog(@"SELFLOCK unlock ThreadID=%p\n",(void*)objc_thread_id()); NSDebugLockMLog(@"SELFLOCK unlock %@", GSCurrentThread());
// LoggedUnlock(selfLock); // LoggedUnlock(selfLock);
[_selfLock unlock];//NEW [_selfLock unlock];//NEW
NSDebugLockMLog(@"SELFLOCK unlocked ThreadID=%p\n",(void*)objc_thread_id()); NSDebugLockMLog(@"SELFLOCK unlocked %@", GSCurrentThread());
#ifndef NDEBUG #ifndef NDEBUG
_selfLockn--; _selfLockn--;
if (_selfLockn==0) if (_selfLockn==0)
_selfLock_thread_id=NULL; _selfLock_thread_id=NULL;
#endif #endif
/* NSDebugMLLog(@"application",@"selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p", /* NSDebugMLLog(@"application",@"selfLockn=%d selfLock_thread_id=%@ "
selfLockn, @"GSCurrentThread()=%@",
(void*)selfLock_thread_id, selfLockn,
(void*)objc_thread_id()); selfLock_thread_id,
GSCurrentThread());
*/ */
} }
NS_HANDLER NS_HANDLER
{ {
NSDebugMLLog(@"application",@"selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p", NSDebugMLLog(@"application",
@"selfLockn=%d selfLock_thread_id=%@ GSCurrentThread()=%@",
_selfLockn, _selfLockn,
(void*)_selfLock_thread_id, _selfLock_thread_id,
(void*)objc_thread_id()); GSCurrentThread());
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"selfLock loggedunlock"); @"selfLock loggedunlock");
LOGException(@"%@ (%@)",localException,[localException reason]); LOGException(@"%@ (%@)",localException,[localException reason]);
@ -2572,10 +2585,11 @@ to another instance **/
else else
{ {
if (!ClassIsKindOfClass(_sessionClass,_gswsessionClass)) if (!ClassIsKindOfClass(_sessionClass,_gswsessionClass))
{ {
//TODO exception //TODO exception
NSDebugMLLog(@"application",@"session class is not a kind of GSWSession\n"); NSDebugMLLog(@"application",
} @"session class is not a kind of GSWSession");
}
}; };
NSDebugMLLog(@"application",@"_sessionClass:%@",_sessionClass); NSDebugMLLog(@"application",@"_sessionClass:%@",_sessionClass);
*/ */
@ -2904,7 +2918,7 @@ to another instance **/
SEL unregisterForEventsSEL=NULL; SEL unregisterForEventsSEL=NULL;
NSDebugMLLog0(@"application",@"GSWApplication run"); NSDebugMLLog0(@"application",@"GSWApplication run");
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLog(@"ThreadID=%p\n",(void*)objc_thread_id()); NSDebugMLog(@"%@", GSCurrentThread());
registerForEventsSEL=@selector(registerForEvents); registerForEventsSEL=@selector(registerForEvents);
unregisterForEventsSEL=@selector(unregisterForEvents); unregisterForEventsSEL=@selector(unregisterForEvents);
NSDebugMLLog(@"application",@"adaptors=%@",_adaptors); NSDebugMLLog(@"application",@"adaptors=%@",_adaptors);
@ -2912,8 +2926,10 @@ to another instance **/
NSDebugMLLog0(@"application",@"NSRunLoop run"); NSDebugMLLog0(@"application",@"NSRunLoop run");
//call adaptor run //call adaptor run
//call self _openInitialURL //call self _openInitialURL
NSDebugMLLog(@"application",@"GSCurrentThreadDictionary()=%@",GSCurrentThreadDictionary()); NSDebugMLLog(@"application",@"GSCurrentThreadDictionary()=%@",
NSDebugMLLog(@"application",@"[NSRunLoop currentRunLoop]=%@",[NSRunLoop currentRunLoop]); GSCurrentThreadDictionary());
NSDebugMLLog(@"application",@"[NSRunLoop currentRunLoop]=%@",
[NSRunLoop currentRunLoop]);
NSAssert(_currentRunLoop,@"No runLoop"); NSAssert(_currentRunLoop,@"No runLoop");
NS_DURING NS_DURING
@ -5596,7 +5612,8 @@ to another instance **/
superClassName:(NSString*)superClassName superClassName:(NSString*)superClassName
{ {
LOGClassFnStart(); LOGClassFnStart();
NSDebugMLLog(@"gswdync",@"ClassName:%@ superClassName:%@\n",className,superClassName); NSDebugMLLog(@"gswdync",@"ClassName:%@ superClassName:%@",
className, superClassName);
[localDynCreateClassNames setObject:superClassName [localDynCreateClassNames setObject:superClassName
forKey:className]; forKey:className];
LOGClassFnStop(); LOGClassFnStop();
@ -5699,11 +5716,11 @@ to another instance **/
{ {
GSWComponent* component=nil; GSWComponent* component=nil;
Class aClass=nil; Class aClass=nil;
NSDebugMLLog(@"application",@"Page with Name:%@\n",name_); NSDebugMLLog(@"application",@"Page with Name:%@",name_);
//No Name ==> "Main" //No Name ==> "Main"
if (!name_ || [name_ length]==0) if (!name_ || [name_ length]==0)
name_=GSWMainPageName; name_=GSWMainPageName;
NSDebugMLLog(@"gswcomponents",@"Page with Name:%@\n",name_); NSDebugMLLog(@"gswcomponents",@"Page with Name:%@",name_);
aClass=NSClassFromString(name_); aClass=NSClassFromString(name_);
//If not found, search for library //If not found, search for library
if (!aClass) if (!aClass)
@ -5726,26 +5743,27 @@ to another instance **/
if (!aClass) if (!aClass)
{ {
//TODO exception //TODO exception
NSDebugMLLog0(@"application",@"No component class\n"); NSDebugMLLog0(@"application",@"No component class");
} }
else else
{ {
Class GSWComponentClass=[GSWComponent class]); Class GSWComponentClass=[GSWComponent class]);
if (!ClassIsKindOfClass(aClass,GSWComponentClass)) if (!ClassIsKindOfClass(aClass,GSWComponentClass))
{ {
NSDebugMLLog0(@"application",@"component class is not a kind of GSWComponent\n"); NSDebugMLLog0(@"application",
//TODO exception @"component class is not a kind of GSWComponent");
} //TODO exception
}
else else
{ {
//TODOV //TODOV
NSDebugMLLog0(@"application",@"Create Componnent\n"); NSDebugMLLog0(@"application",@"Create Componnent");
component=[[aClass new] autorelease]; component=[[aClass new] autorelease];
if (!component) if (!component)
{ {
//TODO exception //TODO exception
};
}; };
};
}; };
return component; return component;
@ -5856,38 +5874,42 @@ to another instance **/
//dynamicElementWithName:associations:template: //dynamicElementWithName:associations:template:
//OldFn //OldFn
-(GSWDynamicElement*)dynamicElementWithName:(NSString*)name_ -(GSWDynamicElement*)dynamicElementWithName:(NSString*)name_
associations:(NSDictionary*)someAssociations associations:(NSDictionary*)someAssociations
template:(GSWElement*)templateElement_ template:(GSWElement*)templateElement_
{ {
GSWDynamicElement* element=nil; GSWDynamicElement* element=nil;
// NSString* elementName=[_XMLElement attributeForKey:@"NAME"]; // NSString* elementName=[_XMLElement attributeForKey:@"NAME"];
Class aClass=NSClassFromString(name_); Class aClass=NSClassFromString(name_);
LOGObjectFnNotImplemented(); //TODOFN LOGObjectFnNotImplemented(); //TODOFN
NSDebugMLLog0(@"application",@"Begin GSWApplication:dynamicElementWithName\n"); NSDebugMLLog0(@"application",
@"Begin GSWApplication:dynamicElementWithName");
if (!aClass) if (!aClass)
{
ExceptionRaise(@"GSWApplication",
@"GSWApplication: No class named '%@' for "
@"creating dynamic element",
name_);
}
else
{
Class GSWElementClass=[GSWElement class];
if (!ClassIsKindOfClass(aClass,GSWElementClass))
{ {
ExceptionRaise(@"GSWApplication", ExceptionRaise(@"GSWApplication",
@"GSWApplication: No class named '%@' for creating dynamic element", @"GSWApplication: element '%@' is not kind of "
name_); @"GSWElement",
name_);
} }
else else
{ {
Class GSWElementClass=[GSWElement class]; NSDebugMLLog(@"application",
if (!ClassIsKindOfClass(aClass,GSWElementClass)) @"Creating DynamicElement of Class:%@",aClass);
{ element=[[[aClass alloc] initWithName:name_
ExceptionRaise(@"GSWApplication", associations:someAssociations
@"GSWApplication: element '%@' is not kind of GSWElement", template:templateElement_] autorelease];
name_); NSDebugMLLog(@"application",@"Creating DynamicElement:%@",element);
}
else
{
NSDebugMLLog(@"application",@"Creating DynamicElement of Class:%@\n",aClass);
element=[[[aClass alloc] initWithName:name_
associations:someAssociations
template:templateElement_] autorelease];
NSDebugMLLog(@"application",@"Creating DynamicElement:%@\n",element);
};
}; };
};
return element; return element;
}; };

View file

@ -1116,8 +1116,10 @@ associationsKeys:(NSArray*)associationsKeys
#ifndef NDEBUG #ifndef NDEBUG
if(GSDebugSet(@"gswcomponents") == YES) if(GSDebugSet(@"gswcomponents") == YES)
[aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"\n<!-- Stop %@ [%@]-->\n", [aResponse appendDebugCommentContentString:
[self _templateName],[aContext elementID]]];//TODO enlever [NSString stringWithFormat:@"\n<!-- Stop %@ [%@]-->\n",
[self _templateName],
[aContext elementID]]];//TODO enlever
#endif #endif
GSWAssertIsElementID(aContext); GSWAssertIsElementID(aContext);
LOGObjectFnStop(); LOGObjectFnStop();
@ -1925,7 +1927,7 @@ associationsKeys:(NSArray*)associationsKeys
languages:(NSArray*)languages languages:(NSArray*)languages
{ {
GSWElement* rootElement=nil; GSWElement* rootElement=nil;
NSDebugMLog0(@"Begin GSWComponent:templateWithHTMLString...\n"); NSDebugMLog0(@"Begin GSWComponent:templateWithHTMLString...");
rootElement=[GSWTemplateParser templateWithHTMLString:htmlString rootElement=[GSWTemplateParser templateWithHTMLString:htmlString
declarationString:pageDefString declarationString:pageDefString
languages:languages]; languages:languages];

View file

@ -57,7 +57,8 @@ static int dontTraceComponentActionURL=0;
-(void)dealloc -(void)dealloc
{ {
GSWLogAssertGood(self); GSWLogAssertGood(self);
NSDebugFLog(@"Dealloc GSWContext %p. ThreadID=%p",(void*)self,(void*)objc_thread_id()); NSDebugFLog(@"Dealloc GSWContext %p. %@",
(void*)self, GSCurrentThread());
NSDebugFLog0(@"Release GSWContext senderID"); NSDebugFLog0(@"Release GSWContext senderID");
DESTROY(_senderID); DESTROY(_senderID);
NSDebugFLog0(@"Release GSWContext requestSessionID"); NSDebugFLog0(@"Release GSWContext requestSessionID");
@ -1476,7 +1477,7 @@ If none, try request languages
-(void)setValidate:(BOOL)isValidate -(void)setValidate:(BOOL)isValidate
{ {
_isValidate = isValidate; _isValidate = isValidate;
NSDebugMLLog(@"low",@"isValidate=%d\n",(int)isValidate); NSDebugMLLog(@"low",@"isValidate=%d",(int)isValidate);
}; };
@end @end

View file

@ -61,21 +61,9 @@ NSString* GSWDebugMethodMsg(id obj, SEL sel, const char *file, int line, NSStrin
void GSWLogC_(CONST char* file,int line,CONST char* string) void GSWLogC_(CONST char* file,int line,CONST char* string)
{ {
int len=0; int len=0;
/* if ([NSThread isMultiThreaded]) const char *thread=[[GSCurrentThread() description] cString];
{
NSThread* t = [NSThread currentThread]; fprintf(stderr,"%s (%d) ", thread, (int)getpid());
fprintf(stderr,"TID=");
#if 0
if (t && t->_thread_id)
fprintf(stderr,"%p [%ld] (%d) ",(void*)t->_thread_id,(long)t->_thread_id,(int)getpid());
else
#endif
{
*/
void* tid=(void*)objc_thread_id();
fprintf(stderr,"%p [%ld] (%d) ",tid,(long)tid,(int)getpid());
/* };
};*/
fprintf(stderr,"File %s: %d. ",file,line); fprintf(stderr,"File %s: %d. ",file,line);
fprintf(stderr,string); fprintf(stderr,string);
len=strlen(string); len=strlen(string);
@ -339,8 +327,10 @@ void GSWLogDumpObjectFn(CONST char* file,int line,id object,int deep)
Class class = [object class]; Class class = [object class];
if (class) if (class)
{ {
NSDebugFLog(@"--%s %d [%d] Dumping object %p of Class %s Description:%@\n", NSDebugFLog(@"--%s %d [%d] Dumping object %p of Class %s "
(file && isalpha(*file) && line>=0 && line<=20000) ? file :"", @"Description:%@",
((file && isalpha(*file) && line>=0 && line<=20000)
? file : ""),
line, line,
deep, deep,
(void*)object, (void*)object,

View file

@ -105,7 +105,8 @@ int allow_severity = LOG_INFO;
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)registerForEvents -(void)registerForEvents
{ {
NSDebugDeepMLog(@"START registerForEvents - ThreadID=%p",(void*)objc_thread_id()); NSDebugDeepMLog(@"START registerForEvents - %@",
GSCurrentThread());
NSAssert(!_fileHandle,@"fileHandle already exists"); NSAssert(!_fileHandle,@"fileHandle already exists");
NSDebugDeepMLLog(@"info",@"registerForEvents port=%d",_port); NSDebugDeepMLLog(@"info",@"registerForEvents port=%d",_port);
NSDebugDeepMLLog(@"info",@"registerForEvents host=%@",_host); NSDebugDeepMLLog(@"info",@"registerForEvents host=%@",_host);
@ -116,7 +117,7 @@ int allow_severity = LOG_INFO;
_fileHandle=[[NSFileHandle fileHandleAsServerAtAddress:_host _fileHandle=[[NSFileHandle fileHandleAsServerAtAddress:_host
service:[NSString stringWithFormat:@"%d",_port] service:[NSString stringWithFormat:@"%d",_port]
protocol:@"tcp"] retain]; protocol:@"tcp"] retain];
NSDebugDeepMLLog(@"info",@"fileHandle=%p\n",(void*)_fileHandle); NSDebugDeepMLLog(@"info",@"fileHandle=%p",(void*)_fileHandle);
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector: @selector(announceNewConnection:) selector: @selector(announceNewConnection:)
name: NSFileHandleConnectionAcceptedNotification name: NSFileHandleConnectionAcceptedNotification
@ -127,9 +128,11 @@ int allow_severity = LOG_INFO;
object:fileHandle]; object:fileHandle];
*/ */
[_fileHandle acceptConnectionInBackgroundAndNotify]; [_fileHandle acceptConnectionInBackgroundAndNotify];
NSDebugDeepMLog(@"ThreadID=%p - B readInProgress=%d",(void*)objc_thread_id(),(int)[_fileHandle readInProgress]); NSDebugDeepMLog(@"%@ - B readInProgress=%d",
[GSWApplication statusLogWithFormat:@"ThreadID %p: Waiting for connections on %@:%d.", GSCurrentThread(),(int)[_fileHandle readInProgress]);
(void*)objc_thread_id(), [GSWApplication statusLogWithFormat:
@"Thread %@: Waiting for connections on %@:%d.",
GSCurrentThread(),
_host, _host,
_port]; _port];
NSDebugDeepMLog(@"STOP registerForEvents"); NSDebugDeepMLog(@"STOP registerForEvents");
@ -303,20 +306,23 @@ int allow_severity = LOG_INFO;
LOGObjectFnStart(); LOGObjectFnStart();
listenHandle=[notification object]; listenHandle=[notification object];
requestDate=[NSCalendarDate calendarDate]; requestDate=[NSCalendarDate calendarDate];
requestDateString=[NSString stringWithFormat:@"ThreadID=%p: New Request %@",(void*)objc_thread_id(),requestDate]; requestDateString=[NSString stringWithFormat:@"%@: New Request %@",
GSCurrentThread(),requestDate];
[GSWApplication statusLogWithFormat:@"%@",requestDateString]; [GSWApplication statusLogWithFormat:@"%@",requestDateString];
NSDebugDeepMLLog(@"info",@"listenHandle=%p",(void*)listenHandle); NSDebugDeepMLLog(@"info",@"listenHandle=%p",(void*)listenHandle);
inStream = [[notification userInfo]objectForKey:@"NSFileHandleNotificationFileHandleItem"]; inStream = [[notification userInfo]objectForKey:@"NSFileHandleNotificationFileHandleItem"];
NSDebugDeepMLog(@"ThreadID=%p announceNewConnection notification=%@ socketAddress=%@ [notification userInfo]=%p\n", NSDebugDeepMLog(@"%@ announceNewConnection notification=%@ "
(void*)objc_thread_id(), @"socketAddress=%@ [notification userInfo]=%p",
GSCurrentThread(),
notification, notification,
[inStream socketAddress], [inStream socketAddress],
[notification userInfo]); [notification userInfo]);
if (![self isConnectionAllowedWithHandle:inStream if (![self isConnectionAllowedWithHandle:inStream
returnedMessage:&connRefusedMessage]) returnedMessage:&connRefusedMessage])
{ {
NSDebugDeepMLog(@"DESTROY the connection: conn refused - ThreadID=%p - A1 readInProgress=%d\n", NSDebugDeepMLog(@"DESTROY the connection: conn refused - "
(void*)objc_thread_id(), @"%@ - A1 readInProgress=%d",
GSCurrentThread(),
(int)[_fileHandle readInProgress]); (int)[_fileHandle readInProgress]);
[GSWDefaultAdaptorThread sendConnectionRefusedResponseToStream:inStream [GSWDefaultAdaptorThread sendConnectionRefusedResponseToStream:inStream
withMessage:connRefusedMessage]; withMessage:connRefusedMessage];
@ -324,23 +330,26 @@ int allow_severity = LOG_INFO;
} }
else else
{ {
NSDebugDeepMLLog(@"info",@"notification userInfo=%@\n", NSDebugDeepMLLog(@"info",@"notification userInfo=%@",
[notification userInfo]); [notification userInfo]);
NSDebugDeepMLog(@"ThreadID=%p - A1 readInProgress=%d", NSDebugDeepMLog(@"%@ - A1 readInProgress=%d",
(void*)objc_thread_id(), GSCurrentThread(),
(int)[_fileHandle readInProgress]); (int)[_fileHandle readInProgress]);
NSDebugDeepMLLog(@"ThreadID=%p - A1 readInProgress=%d\n", NSDebugDeepMLLog(@"%@ - A1 readInProgress=%d",
(void*)objc_thread_id(), GSCurrentThread(),
(int)[_fileHandle readInProgress]); (int)[_fileHandle readInProgress]);
NSDebugDeepMLog(@"NEW CONN APP _selfLockn=%d _selfLock_thread_id=%p _globalLockn=%d _globalLock_thread_id=%p threads count=%d waitingThreads count=%d blocked=%d\n", NSDebugDeepMLog(@"NEW CONN APP _selfLockn=%d _selfLock_thread_id=%@ "
(int)([GSWApplication application]->_selfLockn), @"_globalLockn=%d _globalLock_thread_id=%@ "
(void*)([GSWApplication application]->_selfLock_thread_id), @"threads count=%d waitingThreads count=%d blocked=%d",
(int)([GSWApplication application]->_globalLockn), (int)([GSWApplication application]->_selfLockn),
(void*)([GSWApplication application]->_globalLock_thread_id), ([GSWApplication application]->_selfLock_thread_id),
[_threads count], (int)([GSWApplication application]->_globalLockn),
[_waitingThreads count], ([GSWApplication application]->_globalLock_thread_id),
_blocked); [_threads count],
NSDebugDeepMLog(@"[waitingThreads count]=%d queueSize=%d",[_waitingThreads count],_queueSize); [_waitingThreads count],
_blocked);
NSDebugDeepMLog(@"[waitingThreads count]=%d queueSize=%d",
[_waitingThreads count],_queueSize);
if ([_waitingThreads count]>=_queueSize) if ([_waitingThreads count]>=_queueSize)
{ {
//remove expired thread //remove expired thread
@ -377,8 +386,9 @@ int allow_severity = LOG_INFO;
}; };
if ([_waitingThreads count]>=_queueSize) if ([_waitingThreads count]>=_queueSize)
{ {
NSDebugDeepMLog(@"DESTROY the connection: too many conn - ThreadID=%p - A1 readInProgress=%d\n", NSDebugDeepMLog(@"DESTROY the connection: too many conn - "
(void*)objc_thread_id(), @"%@ - A1 readInProgress=%d",
GSCurrentThread(),
(int)[_fileHandle readInProgress]); (int)[_fileHandle readInProgress]);
[GSWDefaultAdaptorThread sendRetryLasterResponseToStream:inStream]; [GSWDefaultAdaptorThread sendRetryLasterResponseToStream:inStream];
inStream=nil; inStream=nil;
@ -409,13 +419,17 @@ int allow_severity = LOG_INFO;
if (_isMultiThreadEnabled) if (_isMultiThreadEnabled)
{ {
requestDate=[NSCalendarDate calendarDate]; requestDate=[NSCalendarDate calendarDate];
requestDateString=[NSString stringWithFormat:@"ThreadID=%p : Lauch Thread (Multi) %@", requestDateString
(void*)objc_thread_id(), =[NSString stringWithFormat:@"%@ : "
requestDate]; @"Lauch Thread (Multi) %@",
[GSWApplication statusLogWithFormat:@"%@",requestDateString]; GSCurrentThread(),
requestDate];
[GSWApplication statusLogWithFormat:@"%@",
requestDateString];
NSDebugLockMLLog(@"info", NSDebugLockMLLog(@"info",
@"ThreadID=%p : Lauch Thread (Multi) %p", @"%@ : "
(void*)objc_thread_id(), @"Lauch Thread (Multi) %p",
GSCurrentThread(),
(void*)newThread); (void*)newThread);
[NSThread detachNewThreadSelector:@selector(run:) [NSThread detachNewThreadSelector:@selector(run:)
toTarget:newThread toTarget:newThread
@ -490,16 +504,19 @@ int allow_severity = LOG_INFO;
{ {
[listenHandle acceptConnectionInBackgroundAndNotify]; [listenHandle acceptConnectionInBackgroundAndNotify];
_blocked=NO; _blocked=NO;
NSDebugDeepMLog(@"ACCEPT ThreadID=%p A2 readInProgress=%d\n", NSDebugDeepMLog(@"ACCEPT %@ A2 readInProgress=%d",
(void*)objc_thread_id(),(int)[_fileHandle readInProgress]); GSCurrentThread(),
(int)[_fileHandle readInProgress]);
} }
else else
{ {
NSDebugDeepMLog(@"NOT ACCEPT ThreadID=%p A2 readInProgress=%d\n", NSDebugDeepMLog(@"NOT ACCEPT %@ A2 readInProgress=%d",
(void*)objc_thread_id(),(int)[_fileHandle readInProgress]); GSCurrentThread(),
(int)[_fileHandle readInProgress]);
}; };
NSDebugLockMLog(@"ThreadID=%p A2 readInProgress=%d", NSDebugLockMLog(@"%@ A2 readInProgress=%d",
(void*)objc_thread_id(),(int)[_fileHandle readInProgress]); GSCurrentThread(),
(int)[_fileHandle readInProgress]);
} }
NS_HANDLER NS_HANDLER
{ {
@ -516,14 +533,17 @@ int allow_severity = LOG_INFO;
[self unlock]; [self unlock];
}; };
NSDebugLockMLLog(@"trace",@"end announceNewConnection"); NSDebugLockMLLog(@"trace",@"end announceNewConnection");
NSDebugDeepMLog(@"END NEWCONN APP _selfLockn=%d _selfLock_thread_id=%p _globalLockn=%d _globalLock_thread_id=%p threads count=%d waitingThreads count=%d blocked=%d acceptOK\n", NSDebugDeepMLog(@"END NEWCONN APP _selfLockn=%d _selfLock_thread_id=%@ "
(int)([GSWApplication application]->_selfLockn), @"_globalLockn=%d _globalLock_thread_id=%@ "
(void*)([GSWApplication application]->_selfLock_thread_id), @"threads count=%d waitingThreads count=%d "
(int)([GSWApplication application]->_globalLockn), @"blocked=%d acceptOK",
(void*)([GSWApplication application]->_globalLock_thread_id), (int)([GSWApplication application]->_selfLockn),
[_threads count], ([GSWApplication application]->_selfLock_thread_id),
[_waitingThreads count], (int)([GSWApplication application]->_globalLockn),
_blocked); ([GSWApplication application]->_globalLock_thread_id),
[_threads count],
[_waitingThreads count],
_blocked);
LOGObjectFnStop(); LOGObjectFnStop();
return self; return self;
}; };
@ -533,15 +553,17 @@ int allow_severity = LOG_INFO;
{ {
LOGObjectFnStart(); LOGObjectFnStart();
// NSDebugMLLog(@"trace",@"adaptorThreadExited"); // NSDebugMLLog(@"trace",@"adaptorThreadExited");
NSDebugDeepMLog0(@"adaptorThreadExited\n"); NSDebugDeepMLog0(@"adaptorThreadExited");
NSDebugDeepMLog(@"EXIT APP _selfLockn=%d _selfLock_thread_id=%p _globalLockn=%d _globalLock_thread_id=%p threads count=%d waitingThreads count=%d blocked=%d\n", NSDebugDeepMLog(@"EXIT APP _selfLockn=%d _selfLock_thread_id=%@ "
(int)([GSWApplication application]->_selfLockn), @"_globalLockn=%d _globalLock_thread_id=%@ "
(void*)([GSWApplication application]->_selfLock_thread_id), @"threads count=%d waitingThreads count=%d blocked=%d",
(int)([GSWApplication application]->_globalLockn), (int)([GSWApplication application]->_selfLockn),
(void*)([GSWApplication application]->_globalLock_thread_id), ([GSWApplication application]->_selfLock_thread_id),
[_threads count], (int)([GSWApplication application]->_globalLockn),
[_waitingThreads count], ([GSWApplication application]->_globalLock_thread_id),
_blocked); [_threads count],
[_waitingThreads count],
_blocked);
if ([self tryLock]) if ([self tryLock])
{ {
@ -657,8 +679,9 @@ int allow_severity = LOG_INFO;
BOOL accept=[_waitingThreads count]<_queueSize; BOOL accept=[_waitingThreads count]<_queueSize;
if (_blocked && accept) if (_blocked && accept)
{ {
NSDebugDeepMLog(@"ACCEPT AGAIN ThreadID=%p A2 readInProgress=%d\n", NSDebugDeepMLog(@"ACCEPT AGAIN %@ A2 readInProgress=%d",
(void*)objc_thread_id(),(int)[_fileHandle readInProgress]); GSCurrentThread(),
(int)[_fileHandle readInProgress]);
[_fileHandle acceptConnectionInBackgroundAndNotify]; [_fileHandle acceptConnectionInBackgroundAndNotify];
_blocked=NO; _blocked=NO;
}; };
@ -680,17 +703,19 @@ int allow_severity = LOG_INFO;
[self unlock]; [self unlock];
}; };
NSDebugDeepMLog(@"END EXIT APP _selfLockn=%d _selfLock_thread_id=%p _globalLockn=%d _globalLock_thread_id=%p threads count=%d waitingThreads count=%d blocked=%d\n", NSDebugDeepMLog(@"END EXIT APP _selfLockn=%d _selfLock_thread_id=%@ "
(int)([GSWApplication application]->_selfLockn), @"_globalLockn=%d _globalLock_thread_id=%@ "
(void*)([GSWApplication application]->_selfLock_thread_id), @"threads count=%d waitingThreads count=%d blocked=%d",
(int)([GSWApplication application]->_globalLockn), (int)([GSWApplication application]->_selfLockn),
(void*)([GSWApplication application]->_globalLock_thread_id), ([GSWApplication application]->_selfLock_thread_id),
[_threads count], ([GSWApplication application]->_globalLockn),
[_waitingThreads count], ([GSWApplication application]->_globalLock_thread_id),
_blocked); [_threads count],
[_waitingThreads count],
_blocked);
// (int)(((UnixFileHandle*)fileHandle)->acceptOK)); // (int)(((UnixFileHandle*)fileHandle)->acceptOK));
NSDebugLockMLog(@"ThreadID=%p B2 readInProgress=%d", NSDebugLockMLog(@"%@ B2 readInProgress=%d",
(void*)objc_thread_id(),(int)[_fileHandle readInProgress]); GSCurrentThread(),(int)[_fileHandle readInProgress]);
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -714,12 +739,12 @@ int allow_severity = LOG_INFO;
{ {
BOOL locked=NO; BOOL locked=NO;
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugLockMLog(@"self=%p ThreadID=%p TRYLOCK\n", NSDebugLockMLog(@"self=%p %@ TRYLOCK",
self,(void*)objc_thread_id()); self, GSCurrentThread());
locked=LoggedTryLockBeforeDate(_selfLock, locked=LoggedTryLockBeforeDate(_selfLock,
[NSDate dateWithTimeIntervalSinceNow:90]); [NSDate dateWithTimeIntervalSinceNow:90]);
NSDebugLockMLog(@"self=%p ThreadID=%p TRYLOCK LOCKED ?\n", NSDebugLockMLog(@"self=%p %@ TRYLOCK LOCKED ?",
self,(void*)objc_thread_id()); self, GSCurrentThread());
LOGObjectFnStop(); LOGObjectFnStop();
return locked; return locked;
}; };
@ -729,11 +754,11 @@ int allow_severity = LOG_INFO;
-(void)unlock -(void)unlock
{ {
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugLockMLog(@"self=%p ThreadID=%p UNLOCK\n", NSDebugLockMLog(@"self=%p %@ UNLOCK",
self,(void*)objc_thread_id()); self, GSCurrentThread());
LoggedUnlock(_selfLock); LoggedUnlock(_selfLock);
NSDebugLockMLog(@"self=%p ThreadID=%p UNLOCK UNLOCKED ?\n", NSDebugLockMLog(@"self=%p %@ UNLOCK UNLOCKED ?",
self,(void*)objc_thread_id()); self, GSCurrentThread());
LOGObjectFnStop(); LOGObjectFnStop();
}; };

View file

@ -107,10 +107,11 @@ RCS_ID("$Id$")
{ {
if (destroy) if (destroy)
{ {
GSWLogMemC("dealloc pool\n"); GSWLogMemC("dealloc pool");
GSWLogMemCF("Destroy NSAutoreleasePool: %p. ThreadID=%p",_pool,(void*)objc_thread_id()); GSWLogMemCF("Destroy NSAutoreleasePool: %p. %@",
_pool, GSCurrentThread());
DESTROY(_pool); DESTROY(_pool);
GSWLogMemC("end dealloc pool\n"); GSWLogMemC("end dealloc pool");
}; };
_pool=pool; _pool=pool;
}; };
@ -236,8 +237,8 @@ RCS_ID("$Id$")
}; };
}; };
}; };
NSDebugMLog(@"GSWDefaultAdaptorThread: ThreadID=%p run end", NSDebugMLog(@"GSWDefaultAdaptorThread: %@ run end",
(void*)objc_thread_id()); GSCurrentThread());
NSDebugMLLog(@"low",@"application:%@", NSDebugMLLog(@"low",@"application:%@",
_application); _application);
LOGObjectFnStop(); LOGObjectFnStop();
@ -272,7 +273,7 @@ RCS_ID("$Id$")
[self setPool:nil [self setPool:nil
destroyLast:YES]; destroyLast:YES];
// LOGObjectFnStop(); // LOGObjectFnStop();
GSWLogDeepC("threadExited\n"); GSWLogDeepC("threadExited");
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -783,7 +784,7 @@ withAdditionalHeaderLines:(NSArray*)addHeaders
-(BOOL)isExpired -(BOOL)isExpired
{ {
BOOL isExpired=(fabs([_creationDate timeIntervalSinceNow])>ADAPTOR_THREAD_TIME_OUT); BOOL isExpired=(fabs([_creationDate timeIntervalSinceNow])>ADAPTOR_THREAD_TIME_OUT);
NSDebugDeepMLog(@"EXPIRED %@ %f isExpired=%d\n",//connectOK=%d isExpired=%d\n", NSDebugDeepMLog(@"EXPIRED %@ %f isExpired=%d",//connectOK=%d isExpired=%d",
_creationDate, _creationDate,
[_creationDate timeIntervalSinceNow], [_creationDate timeIntervalSinceNow],
//(int)(((UnixFileHandle*)stream)->connectOK), //(int)(((UnixFileHandle*)stream)->connectOK),
@ -808,7 +809,7 @@ withAdditionalHeaderLines:(NSArray*)addHeaders
forRequest:nil forRequest:nil
forceFinalize:YES]; forceFinalize:YES];
[response setStatus:503];//503=Service Unavailable [response setStatus:503];//503=Service Unavailable
NSDebugDeepMLog0(@"sendResponse:\n"); NSDebugDeepMLog0(@"sendResponse:");
[self sendResponse:response [self sendResponse:response
toStream:stream toStream:stream
withNamingConv:GSWNAMES_INDEX withNamingConv:GSWNAMES_INDEX
@ -832,7 +833,7 @@ withAdditionalHeaderLines:(NSArray*)addHeaders
forRequest:nil forRequest:nil
forceFinalize:YES]; forceFinalize:YES];
[response setStatus:503];//503=Service Unavailable [response setStatus:503];//503=Service Unavailable
NSDebugDeepMLog0(@"sendResponse:\n"); NSDebugDeepMLog0(@"sendResponse:");
[self sendResponse:response [self sendResponse:response
toStream:stream toStream:stream
withNamingConv:GSWNAMES_INDEX withNamingConv:GSWNAMES_INDEX

View file

@ -61,7 +61,7 @@ RCS_ID("$Id$")
_absolutePathsCache=[NSMutableDictionary new]; _absolutePathsCache=[NSMutableDictionary new];
_urlsCache=[NSMutableDictionary new]; _urlsCache=[NSMutableDictionary new];
#ifndef NDEBUG #ifndef NDEBUG
_creation_thread_id=objc_thread_id(); _creation_thread_id=GSCurrentThread();
#endif #endif
_selfLock=[NSRecursiveLock new]; _selfLock=[NSRecursiveLock new];
}; };
@ -80,12 +80,13 @@ RCS_ID("$Id$")
DESTROY(_absolutePathsCache); DESTROY(_absolutePathsCache);
DESTROY(_urlsCache); DESTROY(_urlsCache);
GSWLogC("Dealloc GSWDeployedBundle: selfLock"); GSWLogC("Dealloc GSWDeployedBundle: selfLock");
NSDebugFLog(@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p creation_thread_id=%p", NSDebugFLog(@"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
@"GSCurrentThread()=%@ creation_thread_id=%@",
(void*)_selfLock, (void*)_selfLock,
_selfLockn, _selfLockn,
(void*)_selfLock_thread_id, _selfLock_thread_id,
(void*)objc_thread_id(), GSCurrentThread(),
(void*)_creation_thread_id); _creation_thread_id);
fflush(stderr); fflush(stderr);
DESTROY(_selfLock); DESTROY(_selfLock);
GSWLogC("Dealloc GSWDeployedBundle Super"); GSWLogC("Dealloc GSWDeployedBundle Super");
@ -644,15 +645,15 @@ if it was not cached **/
{ {
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"bundles", NSDebugMLLog(@"bundles",
@"selfLock=%p selfLockn=%d selfLock_thread_id=%p " @"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
@"objc_thread_id()=%p", @"GSCurrentThread()=%@",
(void*)_selfLock, (void*)_selfLock,
_selfLockn, _selfLockn,
(void*)_selfLock_thread_id, _selfLock_thread_id,
(void*)objc_thread_id()); GSCurrentThread());
if (_selfLockn>0) if (_selfLockn>0)
{ {
if (_selfLock_thread_id!=objc_thread_id()) if (_selfLock_thread_id!=GSCurrentThread())
{ {
NSDebugMLog0(@"PROBLEM: owner!=thread id"); NSDebugMLog0(@"PROBLEM: owner!=thread id");
}; };
@ -660,15 +661,15 @@ if it was not cached **/
LoggedLockBeforeDate(_selfLock,GSW_LOCK_LIMIT); LoggedLockBeforeDate(_selfLock,GSW_LOCK_LIMIT);
#ifndef NDEBUG #ifndef NDEBUG
_selfLockn++; _selfLockn++;
_selfLock_thread_id=objc_thread_id(); _selfLock_thread_id=GSCurrentThread();
#endif #endif
NSDebugMLLog(@"bundles", NSDebugMLLog(@"bundles",
@"selfLock=%p selfLockn=%d selfLock_thread_id=%p " @"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
@"objc_thread_id()=%p", @"GSCurrentThread()=%@",
_selfLock, _selfLock,
_selfLockn, _selfLockn,
(void*)_selfLock_thread_id, _selfLock_thread_id,
(void*)objc_thread_id()); GSCurrentThread());
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -677,14 +678,16 @@ if it was not cached **/
-(void)unlock -(void)unlock
{ {
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p", NSDebugMLLog(@"bundles",
@"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
@"GSCurrentThread()=%@",
(void*)_selfLock, (void*)_selfLock,
_selfLockn, _selfLockn,
(void*)_selfLock_thread_id, _selfLock_thread_id,
(void*)objc_thread_id()); GSCurrentThread());
if (_selfLockn>0) if (_selfLockn>0)
{ {
if (_selfLock_thread_id!=objc_thread_id()) if (_selfLock_thread_id!=GSCurrentThread())
{ {
NSDebugMLog0(@"PROBLEM: owner!=thread id"); NSDebugMLog0(@"PROBLEM: owner!=thread id");
}; };
@ -695,11 +698,13 @@ if it was not cached **/
if (_selfLockn==0) if (_selfLockn==0)
_selfLock_thread_id=NULL; _selfLock_thread_id=NULL;
#endif #endif
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p", NSDebugMLLog(@"bundles",
@"selfLock=%p selfLockn=%d selfLock_thread_id=%@ "
@"GSCurrentThread()=%@",
(void*)_selfLock, (void*)_selfLock,
_selfLockn, _selfLockn,
(void*)_selfLock_thread_id, _selfLock_thread_id,
(void*)objc_thread_id()); GSCurrentThread());
LOGObjectFnStop(); LOGObjectFnStop();
}; };

View file

@ -37,6 +37,7 @@ RCS_ID("$Id$")
#include <unistd.h> #include <unistd.h>
#include "GSWeb.h" #include "GSWeb.h"
#include "GSWLifebeatThread.h" #include "GSWLifebeatThread.h"
#include <GNUstepBase/GSCategories.h>
//==================================================================== //====================================================================
@implementation GSWLifebeatThread @implementation GSWLifebeatThread
@ -141,10 +142,11 @@ RCS_ID("$Id$")
{ {
if (destroy) if (destroy)
{ {
GSWLogMemC("dealloc pool\n"); GSWLogMemC("dealloc pool");
GSWLogMemCF("Destroy NSAutoreleasePool: %p. ThreadID=%p",_pool,(void*)objc_thread_id()); GSWLogMemCF("Destroy NSAutoreleasePool: %p. %@",
_pool, GSCurrentThread());
DESTROY(_pool); DESTROY(_pool);
GSWLogMemC("end dealloc pool\n"); GSWLogMemC("end dealloc pool");
}; };
_pool=pool; _pool=pool;
}; };
@ -206,7 +208,7 @@ RCS_ID("$Id$")
[self setPool:nil [self setPool:nil
destroyLast:YES]; destroyLast:YES];
// LOGObjectFnStop(); // LOGObjectFnStop();
GSWLogDeepC("threadExited\n"); GSWLogDeepC("threadExited");
}; };
/* /*
//TODO //TODO

View file

@ -238,11 +238,13 @@ RCS_ID("$Id$")
-(void)dealloc -(void)dealloc
{ {
GSWLogAssertGood(self); GSWLogAssertGood(self);
NSDebugFLog(@"Dealloc GSWSession %p. ThreadID=%p",(void*)self,(void*)objc_thread_id()); NSDebugFLog(@"Dealloc GSWSession %p. %@",
(void*)self, GSCurrentThread());
NSDebugFLog0(@"Dealloc GSWSession: sessionID"); NSDebugFLog0(@"Dealloc GSWSession: sessionID");
DESTROY(_sessionID); DESTROY(_sessionID);
NSDebugFLog0(@"Dealloc GSWSession:autoreleasePool "); NSDebugFLog0(@"Dealloc GSWSession:autoreleasePool ");
GSWLogMemCF("Destroy NSAutoreleasePool: %p. ThreadID=%p",_autoreleasePool,(void*)objc_thread_id()); GSWLogMemCF("Destroy NSAutoreleasePool: %p. %@",
_autoreleasePool, GSCurrentThread());
DESTROY(_autoreleasePool); DESTROY(_autoreleasePool);
NSDebugFLog0(@"Dealloc GSWSession: contextArrayStack"); NSDebugFLog0(@"Dealloc GSWSession: contextArrayStack");
DESTROY(_contextArrayStack); DESTROY(_contextArrayStack);
@ -859,10 +861,10 @@ extern id gcObjectsToBeVisited;
fprintf(stderr,"session %p _releaseAutoreleasePool START\n",self); fprintf(stderr,"session %p _releaseAutoreleasePool START\n",self);
//TODO-NOW remettre [GarbageCollector collectGarbages]; //TODO-NOW remettre [GarbageCollector collectGarbages];
printf("session %p _releaseAutoreleasePool after garbage",self); printf("session %p _releaseAutoreleasePool after garbage",self);
fprintf(stderr,"session %p _releaseAutoreleasePool after garbage\n",self); fprintf(stderr,"session %p _releaseAutoreleasePool after garbage\n",self);
DESTROY(_autoreleasePool); DESTROY(_autoreleasePool);
printf("session %p _releaseAutoreleasePool STOP\n",self); printf("session %p _releaseAutoreleasePool STOP\n",self);
fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self);
LOGObjectFnStop(); LOGObjectFnStop();
}; };