* GSWeb.framework/GSWApplication+Defaults.m

(GSWeb_InitializeGlobalAppDefaultOptions): Add handling for
	GSW/WOStatusLoggingEndabled-GSWOPT_StatusLoggingEnabled.
	Fix handling of user defaults.
	((UserDefaults/GSWUserDefaults)): Split category in handling
	WO45 defaults and GSWeb specific defaults.
	(+is/setStatusLoggingEnabled): New methods and default to
	control status logging.
	(-set/defaultRequestHandlerClassName): Move to GSWApplication
	class implementation as this is not handled via user defaults.
	* GSWeb.framework/GSWApplication.(h/m)
	((UserDefaults/GSWUserDefaults)): Split category in handling
	WO45 defaults and GSWeb specific defaults.
	(+is/setStatusLoggingEnabled): New methods and default to
	control status logging.
	(+set/defaultRequestHandlerClassName): Move to GSWApplication
	class implementation as this is not handled via user defaults.
	(GSWFPutSL): New local macro to consistently log NSString's to
	a stream.  Updated callers to fputs.
	(+statusDebug...): Guard all calls with +isStatusDebuggingEnabled.
	(+statusLog...): Guard all calls with +isStatusLoggingEnabled.
	* GSWeb.framework/GSWConfig.h: Add GSWOPTVALUE_StatusLoggingEnabled.
	* GSWeb.framework/GSWConstants.h/m: Add GSWOPT_StatusLoggingEnabled.

	* GSWeb.framework/GSWHTMLRawParser.m (dealloc): Implement fixing
	a potentially major memory leak.
	* GSWeb.framework/GSWDefaultAdaptorThread.m (dealloc): Destroy
	pool (which should have been destroyed before, in normal operation).
	(run:) Destroy pool in case the threads is rerun.

	* GSWeb.framework/GSWApplication.(h/m) (-debugAdaptorThreadExited):
	New debug utility extension.
	* GSWeb.framework/GSWDefaultAdaptorThread.m (threadExited): Call new
	debug convenience method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@22174 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2005-12-17 16:44:58 +00:00
parent 85ca5d92fd
commit 8ee1195d11
11 changed files with 491 additions and 360 deletions

View file

@ -1,3 +1,40 @@
2005-12-17 David Ayers <d.ayers@inode.at>
* GSWeb.framework/GSWApplication+Defaults.m
(GSWeb_InitializeGlobalAppDefaultOptions): Add handling for
GSW/WOStatusLoggingEndabled-GSWOPT_StatusLoggingEnabled.
Fix handling of user defaults.
((UserDefaults/GSWUserDefaults)): Split category in handling
WO45 defaults and GSWeb specific defaults.
(+is/setStatusLoggingEnabled): New methods and default to
control status logging.
(-set/defaultRequestHandlerClassName): Move to GSWApplication
class implementation as this is not handled via user defaults.
* GSWeb.framework/GSWApplication.(h/m)
((UserDefaults/GSWUserDefaults)): Split category in handling
WO45 defaults and GSWeb specific defaults.
(+is/setStatusLoggingEnabled): New methods and default to
control status logging.
(+set/defaultRequestHandlerClassName): Move to GSWApplication
class implementation as this is not handled via user defaults.
(GSWFPutSL): New local macro to consistently log NSString's to
a stream. Updated callers to fputs.
(+statusDebug...): Guard all calls with +isStatusDebuggingEnabled.
(+statusLog...): Guard all calls with +isStatusLoggingEnabled.
* GSWeb.framework/GSWConfig.h: Add GSWOPTVALUE_StatusLoggingEnabled.
* GSWeb.framework/GSWConstants.h/m: Add GSWOPT_StatusLoggingEnabled.
* GSWeb.framework/GSWHTMLRawParser.m (dealloc): Implement fixing
a potentially major memory leak.
* GSWeb.framework/GSWDefaultAdaptorThread.m (dealloc): Destroy
pool (which should have been destroyed before, in normal operation).
(run:) Destroy pool in case the threads is rerun.
* GSWeb.framework/GSWApplication.(h/m) (-debugAdaptorThreadExited):
New debug utility extension.
* GSWeb.framework/GSWDefaultAdaptorThread.m (threadExited): Call new
debug convenience method.
2005-10-31 David Wetzel <dave@turbocat.de>
* GSWeb.framework/GSWSubmitButton.m

View file

@ -202,9 +202,8 @@ GSWeb_InitializeGlobalAppDefaultOptions(void)
if (!globalAppDefaultOptions)
{
NSDictionary* defaultsOptions = nil;
globalAppDefaultOptions
= [[GSWApplication bundleInfo] objectForKey:@"defaults"];
NSDictionary* gswDefaultsOptions;
NSDictionary* standardUserDefaults = [defaults dictionaryRepresentation];
#define LOGOPT_NC(optname) \
NSDebugFLLog(@"options", @"%s -> %@", \
@ -252,6 +251,8 @@ GSWeb_InitializeGlobalAppDefaultOptions(void)
LOGOPT_NC(GSWOPT_DebuggingEnabled);
LOGOPT (GSWOPTVALUE_StatusDebuggingEnabled);
LOGOPT_NC(GSWOPT_StatusDebuggingEnabled);
LOGOPT (GSWOPTVALUE_StatusLoggingEnabled);
LOGOPT_NC(GSWOPT_StatusLoggingEnabled);
LOGOPT_NC(GSWOPTValue_DirectActionRequestHandlerKey);
LOGOPT_NC(GSWOPT_DirectActionRequestHandlerKey);
@ -335,7 +336,7 @@ GSWeb_InitializeGlobalAppDefaultOptions(void)
#undef LOGOPT
#undef LOGOPT_NC
defaultsOptions =
gswDefaultsOptions =
[NSDictionary dictionaryWithObjectsAndKeys:
GSWClassName_DefaultAdaptor[GSWebNamingConv],
GSWOPT_Adaptor[GSWebNamingConv],
@ -377,6 +378,9 @@ GSWeb_InitializeGlobalAppDefaultOptions(void)
GSWOPTVALUE_StatusDebuggingEnabled,
GSWOPT_StatusDebuggingEnabled[GSWebNamingConv],
GSWOPTVALUE_StatusLoggingEnabled,
GSWOPT_StatusLoggingEnabled[GSWebNamingConv],
GSWOPTValue_DirectActionRequestHandlerKey[GSWebNamingConv],
GSWOPT_DirectActionRequestHandlerKey[GSWebNamingConv],
@ -475,8 +479,9 @@ GSWeb_InitializeGlobalAppDefaultOptions(void)
NSDebugFLLog(@"options",@"_globalAppDefaultOptions=%@",
globalAppDefaultOptions);
globalAppDefaultOptions
= [NSDictionary dictionaryWithDictionary: globalAppDefaultOptions
andDefaultEntriesFromDictionary: defaultsOptions];
= [NSDictionary dictionaryWithDictionary: standardUserDefaults
andDefaultEntriesFromDictionary: gswDefaultsOptions];
RETAIN(globalAppDefaultOptions);
NSDebugFLLog(@"options",@"_globalAppDefaultOptions=%@",
globalAppDefaultOptions);
}
@ -689,9 +694,7 @@ static NSString *_dflt_requestClassName = nil;
//====================================================================
@implementation GSWApplication (UserDefaults)
//--------------------------------------------------------------------
//TODO: take values from application ?
static BOOL _dflt_init_loadFrameworks = NO;
static NSArray *_dflt_loadFrameworks = nil;
+(NSArray*)loadFrameworks
@ -725,25 +728,6 @@ static BOOL _dflt_debuggingEnabled = NO;
_dflt_init_debuggingEnabled = YES;
};
//--------------------------------------------------------------------
//NDFN
static BOOL _dflt_init_statusDebuggingEnabled = NO;
static BOOL _dflt_statusDebuggingEnabled = NO;
+(BOOL)isStatusDebuggingEnabled
{
INIT_DFLT_BOOL(statusDebuggingEnabled,
GSWOPT_StatusDebuggingEnabled[GSWebNamingConv]);
return _dflt_statusDebuggingEnabled;
};
//--------------------------------------------------------------------
//NDFN
+(void)setStatusDebuggingEnabled:(BOOL)flag
{
_dflt_statusDebuggingEnabled = flag;
_dflt_init_statusDebuggingEnabled = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_autoOpenInBrowser = NO;
static BOOL _dflt_autoOpenInBrowser = NO;
@ -853,23 +837,6 @@ static NSString *_dflt_frameworksBaseURL = nil;
_dflt_init_frameworksBaseURL = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_outputPath = NO;
static NSString *_dflt_outputPath = nil;
+(NSString*)outputPath
{
INIT_DFLT_OBJ(outputPath,
GSWOPT_OutputPath[GSWebNamingConv]);
return _dflt_outputPath;
};
//--------------------------------------------------------------------
+(void)setOutputPath:(NSString*)aString
{
ASSIGNCOPY(_dflt_outputPath, aString);
_dflt_init_outputPath = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_recordingPath = NO;
static NSString *_dflt_recordingPath = nil;
@ -933,78 +900,6 @@ static NSArray *_dflt_projectSearchPath = nil;
_dflt_init_projectSearchPath = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_lifebeatEnabled = NO;
static BOOL _dflt_lifebeatEnabled = NO;
+(BOOL)isLifebeatEnabled
{
INIT_DFLT_BOOL(lifebeatEnabled,
GSWOPT_LifebeatEnabled[GSWebNamingConv]);
return _dflt_lifebeatEnabled;
};
//--------------------------------------------------------------------
+(void)setLifebeatEnabled:(BOOL)flag
{
_dflt_lifebeatEnabled = flag;
_dflt_init_lifebeatEnabled = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_lifebeatDestinationHost = NO;
static NSString *_dflt_lifebeatDestinationHost = nil;
+(NSString*)lifebeatDestinationHost
{
INIT_DFLT_OBJ(lifebeatDestinationHost,
GSWOPT_LifebeatDestinationHost[GSWebNamingConv]);
return _dflt_lifebeatDestinationHost;
};
//--------------------------------------------------------------------
+(void)setLifebeatDestinationHost:(NSString*)host
{
ASSIGNCOPY(_dflt_lifebeatDestinationHost, host);
_dflt_init_lifebeatDestinationHost = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_lifebeatDestinationPort = NO;
static int _dflt_lifebeatDestinationPort = 0;
+(int)lifebeatDestinationPort
{
INIT_DFLT_INT(lifebeatDestinationPort,
GSWOPT_LifebeatDestinationPort[GSWebNamingConv]);
return _dflt_lifebeatDestinationPort;
};
//--------------------------------------------------------------------
+(void)setLifebeatDestinationPort:(int)port
{
_dflt_lifebeatDestinationPort = port;
_dflt_init_lifebeatDestinationPort = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_lifebeatInterval = NO;
static NSTimeInterval _dflt_lifebeatInterval = 0.0;
+(NSTimeInterval)lifebeatInterval
{
LOGClassFnStart();
INIT_DFLT_FLT(lifebeatInterval,
GSWOPT_LifebeatInterval[GSWebNamingConv]);
LOGClassFnStop();
return _dflt_lifebeatInterval;
};
//--------------------------------------------------------------------
+(void)setLifebeatInterval:(NSTimeInterval)interval
{
LOGClassFnStart();
_dflt_lifebeatInterval = interval;
_dflt_init_lifebeatInterval = YES;
LOGClassFnStop();
};
//--------------------------------------------------------------------
static BOOL _dflt_init_monitorEnabled = NO;
static BOOL _dflt_monitorEnabled = NO;
@ -1095,40 +990,6 @@ static NSNumber *_dflt_port = nil;
*/
};
//--------------------------------------------------------------------
+(int)intPort
{
return [[self port]intValue];
};
//--------------------------------------------------------------------
+(void)setIntPort:(int)port
{
[self setPort:GSWIntNumber(port)];
};
//--------------------------------------------------------------------
static BOOL _dflt_init_host= NO;
static NSString *_dflt_host = nil;
+(NSString*)host
{
INIT_DFLT_OBJ(host,
GSWOPT_Host[GSWebNamingConv]);
return _dflt_host;
};
//--------------------------------------------------------------------
+(void)setHost:(NSString*)host
{
ASSIGNCOPY(_dflt_host, host);
_dflt_init_host = YES;
//TODO
/*
[[GSWApp adaptors] makeObjectsPerformSelector:@selector(setHost:)
withObject:host_];
*/
};
//--------------------------------------------------------------------
static BOOL _dflt_init_listenQueueSize = NO;
static id _dflt_listenQueueSize = nil;
@ -1149,9 +1010,15 @@ static id _dflt_listenQueueSize = nil;
};
//--------------------------------------------------------------------
// [deprecated]
// [deprecated] - ayers: Needed for WO45 compatibility.
static BOOL _dflt_init_workerThreadCount = NO;
static id _dflt_workerThreadCount = nil;
/**
* The worker thread count defines the number it threads the
* current [-adaptor] will spawn to handle requests. A value of 0
* indicates single thread mode.
* This values is determined by the WOWorkerThreadCount NSUserDefault.
*/
+(id)workerThreadCount
{
INIT_DFLT_OBJ(workerThreadCount,
@ -1160,7 +1027,13 @@ static id _dflt_workerThreadCount = nil;
};
//--------------------------------------------------------------------
// [deprecated]
// [deprecated] - ayers: Needed for WO45 compatibility.
/**
* The worker thread count defines the number it threads the
* current [-adaptor] will spawn to handle requests. Set this to 0
* to indicate single thread mode.
* This method also sets the WOWorkerThreadCount NSUserDefault.
*/
+(void)setWorkerThreadCount:(id)workerThreadCount
{
ASSIGN(_dflt_workerThreadCount, workerThreadCount);
@ -1169,44 +1042,6 @@ static id _dflt_workerThreadCount = nil;
withObject:workerThreadCount];
};
//--------------------------------------------------------------------
static BOOL _dflt_init_workerThreadCountMin = NO;
static id _dflt_workerThreadCountMin = nil;
+(id)workerThreadCountMin
{
INIT_DFLT_OBJ(workerThreadCountMin,
GSWOPT_WorkerThreadCountMin[GSWebNamingConv]);
return _dflt_workerThreadCountMin;
};
//--------------------------------------------------------------------
+(void)setWorkerThreadCountMin:(id)workerThreadCount
{
ASSIGN(_dflt_workerThreadCountMin, workerThreadCount);
_dflt_init_workerThreadCountMin = YES;
[[GSWApp adaptors] makeObjectsPerformSelector:@selector(setWorkerThreadCountMin:)
withObject:workerThreadCount];
};
//--------------------------------------------------------------------
static BOOL _dflt_init_workerThreadCountMax = NO;
static id _dflt_workerThreadCountMax = nil;
+(id)workerThreadCountMax
{
INIT_DFLT_OBJ(workerThreadCountMax,
GSWOPT_WorkerThreadCountMax[GSWebNamingConv]);
return _dflt_workerThreadCountMax;
};
//--------------------------------------------------------------------
+(void)setWorkerThreadCountMax:(id)workerThreadCount
{
ASSIGN(_dflt_workerThreadCountMax, workerThreadCount);
_dflt_init_workerThreadCountMax = YES;
[[GSWApp adaptors] makeObjectsPerformSelector:@selector(setWorkerThreadCountMax:)
withObject:workerThreadCount];
};
//--------------------------------------------------------------------
static BOOL _dflt_init_additionalAdaptors = NO;
static NSArray *_dflt_additionalAdaptors = nil;
@ -1291,6 +1126,252 @@ static NSString *_dflt_resourceRequestHandlerKey = nil;
_dflt_init_resourceRequestHandlerKey = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_statisticsStoreClassName = NO;
static NSString *_dflt_statisticsStoreClassName = nil;
+(NSString*)statisticsStoreClassName
{
INIT_DFLT_OBJ(statisticsStoreClassName,
GSWOPT_StatisticsStoreClassName[GSWebNamingConv]);
return _dflt_statisticsStoreClassName;
};
//--------------------------------------------------------------------
+(void)setStatisticsStoreClassName:(NSString*)name
{
ASSIGNCOPY(_dflt_statisticsStoreClassName, name);
_dflt_init_statisticsStoreClassName = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_sessionTimeOut = NO;
static NSNumber *_dflt_sessionTimeOut = nil;
+(void)setSessionTimeOut:(NSNumber*)aTimeOut
{
LOGClassFnStart();
NSDebugMLLog(@"sessions",@"aTimeOut=%@",aTimeOut);
ASSIGNCOPY(_dflt_sessionTimeOut, aTimeOut);
_dflt_init_sessionTimeOut = YES;
LOGClassFnStop();
};
//--------------------------------------------------------------------
+(NSNumber*)sessionTimeOut
{
LOGClassFnStart();
INIT_DFLT_OBJ(sessionTimeOut,
GSWOPT_SessionTimeOut[GSWebNamingConv]);
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",
_dflt_sessionTimeOut);
LOGClassFnStop();
return _dflt_sessionTimeOut;
};
@end
//====================================================================
@implementation GSWApplication (GSWUserDefaults)
//--------------------------------------------------------------------
//NDFN
static BOOL _dflt_init_statusDebuggingEnabled = NO;
static BOOL _dflt_statusDebuggingEnabled = NO;
+(BOOL)isStatusDebuggingEnabled
{
INIT_DFLT_BOOL(statusDebuggingEnabled,
GSWOPT_StatusDebuggingEnabled[GSWebNamingConv]);
return _dflt_statusDebuggingEnabled;
};
//--------------------------------------------------------------------
//NDFN
+(void)setStatusDebuggingEnabled:(BOOL)flag
{
_dflt_statusDebuggingEnabled = flag;
_dflt_init_statusDebuggingEnabled = YES;
};
//--------------------------------------------------------------------
//NDFN
static BOOL _dflt_init_statusLoggingEnabled = NO;
static BOOL _dflt_statusLoggingEnabled = NO;
+(BOOL)isStatusLoggingEnabled
{
INIT_DFLT_BOOL(statusLoggingEnabled,
GSWOPT_StatusLoggingEnabled[GSWebNamingConv]);
return _dflt_statusLoggingEnabled;
};
//--------------------------------------------------------------------
//NDFN
+(void)setStatusLoggingEnabled:(BOOL)flag
{
_dflt_statusLoggingEnabled = flag;
_dflt_init_statusLoggingEnabled = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_outputPath = NO;
static NSString *_dflt_outputPath = nil;
+(NSString*)outputPath
{
INIT_DFLT_OBJ(outputPath,
GSWOPT_OutputPath[GSWebNamingConv]);
return _dflt_outputPath;
};
//--------------------------------------------------------------------
+(void)setOutputPath:(NSString*)aString
{
ASSIGNCOPY(_dflt_outputPath, aString);
_dflt_init_outputPath = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_lifebeatEnabled = NO;
static BOOL _dflt_lifebeatEnabled = NO;
+(BOOL)isLifebeatEnabled
{
INIT_DFLT_BOOL(lifebeatEnabled,
GSWOPT_LifebeatEnabled[GSWebNamingConv]);
return _dflt_lifebeatEnabled;
};
//--------------------------------------------------------------------
+(void)setLifebeatEnabled:(BOOL)flag
{
_dflt_lifebeatEnabled = flag;
_dflt_init_lifebeatEnabled = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_lifebeatDestinationHost = NO;
static NSString *_dflt_lifebeatDestinationHost = nil;
+(NSString*)lifebeatDestinationHost
{
INIT_DFLT_OBJ(lifebeatDestinationHost,
GSWOPT_LifebeatDestinationHost[GSWebNamingConv]);
return _dflt_lifebeatDestinationHost;
};
//--------------------------------------------------------------------
+(void)setLifebeatDestinationHost:(NSString*)host
{
ASSIGNCOPY(_dflt_lifebeatDestinationHost, host);
_dflt_init_lifebeatDestinationHost = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_lifebeatDestinationPort = NO;
static int _dflt_lifebeatDestinationPort = 0;
+(int)lifebeatDestinationPort
{
INIT_DFLT_INT(lifebeatDestinationPort,
GSWOPT_LifebeatDestinationPort[GSWebNamingConv]);
return _dflt_lifebeatDestinationPort;
};
//--------------------------------------------------------------------
+(void)setLifebeatDestinationPort:(int)port
{
_dflt_lifebeatDestinationPort = port;
_dflt_init_lifebeatDestinationPort = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_lifebeatInterval = NO;
static NSTimeInterval _dflt_lifebeatInterval = 0.0;
+(NSTimeInterval)lifebeatInterval
{
LOGClassFnStart();
INIT_DFLT_FLT(lifebeatInterval,
GSWOPT_LifebeatInterval[GSWebNamingConv]);
LOGClassFnStop();
return _dflt_lifebeatInterval;
};
//--------------------------------------------------------------------
+(void)setLifebeatInterval:(NSTimeInterval)interval
{
LOGClassFnStart();
_dflt_lifebeatInterval = interval;
_dflt_init_lifebeatInterval = YES;
LOGClassFnStop();
};
//--------------------------------------------------------------------
+(int)intPort
{
return [[self port]intValue];
};
//--------------------------------------------------------------------
+(void)setIntPort:(int)port
{
[self setPort:GSWIntNumber(port)];
};
//--------------------------------------------------------------------
static BOOL _dflt_init_host= NO;
static NSString *_dflt_host = nil;
+(NSString*)host
{
INIT_DFLT_OBJ(host,
GSWOPT_Host[GSWebNamingConv]);
return _dflt_host;
};
//--------------------------------------------------------------------
+(void)setHost:(NSString*)host
{
ASSIGNCOPY(_dflt_host, host);
_dflt_init_host = YES;
//TODO
/*
[[GSWApp adaptors] makeObjectsPerformSelector:@selector(setHost:)
withObject:host_];
*/
};
//--------------------------------------------------------------------
static BOOL _dflt_init_workerThreadCountMin = NO;
static id _dflt_workerThreadCountMin = nil;
+(id)workerThreadCountMin
{
INIT_DFLT_OBJ(workerThreadCountMin,
GSWOPT_WorkerThreadCountMin[GSWebNamingConv]);
return _dflt_workerThreadCountMin;
};
//--------------------------------------------------------------------
+(void)setWorkerThreadCountMin:(id)workerThreadCount
{
ASSIGN(_dflt_workerThreadCountMin, workerThreadCount);
_dflt_init_workerThreadCountMin = YES;
[[GSWApp adaptors] makeObjectsPerformSelector:@selector(setWorkerThreadCountMin:)
withObject:workerThreadCount];
};
//--------------------------------------------------------------------
static BOOL _dflt_init_workerThreadCountMax = NO;
static id _dflt_workerThreadCountMax = nil;
+(id)workerThreadCountMax
{
INIT_DFLT_OBJ(workerThreadCountMax,
GSWOPT_WorkerThreadCountMax[GSWebNamingConv]);
return _dflt_workerThreadCountMax;
};
//--------------------------------------------------------------------
+(void)setWorkerThreadCountMax:(id)workerThreadCount
{
ASSIGN(_dflt_workerThreadCountMax, workerThreadCount);
_dflt_init_workerThreadCountMax = YES;
[[GSWApp adaptors] makeObjectsPerformSelector:@selector(setWorkerThreadCountMax:)
withObject:workerThreadCount];
};
//--------------------------------------------------------------------
static BOOL _dflt_init_streamActionRequestHandlerKey = NO;
static NSString *_dflt_streamActionRequestHandlerKey = nil;
@ -1342,23 +1423,6 @@ static NSString *_dflt_staticResourceRequestHandlerKey = nil;
_dflt_init_staticResourceRequestHandlerKey = YES;
};
//--------------------------------------------------------------------
-(NSString*)defaultRequestHandlerClassName
{
return @"GSWComponentRequestHandle";
};
//--------------------------------------------------------------------
-(Class)defaultRequestHandlerClass
{
Class defaultRequestHandlerClass=Nil;
NSString* className=[self defaultRequestHandlerClassName];
if ([className length]>0)
{
defaultRequestHandlerClass=NSClassFromString(className);
};
return defaultRequestHandlerClass;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_resourceManagerClassName = NO;
@ -1377,23 +1441,6 @@ static NSString *_dflt_resourceManagerClassName = nil;
_dflt_init_resourceManagerClassName = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_statisticsStoreClassName = NO;
static NSString *_dflt_statisticsStoreClassName = nil;
+(NSString*)statisticsStoreClassName
{
INIT_DFLT_OBJ(statisticsStoreClassName,
GSWOPT_StatisticsStoreClassName[GSWebNamingConv]);
return _dflt_statisticsStoreClassName;
};
//--------------------------------------------------------------------
+(void)setStatisticsStoreClassName:(NSString*)name
{
ASSIGNCOPY(_dflt_statisticsStoreClassName, name);
_dflt_init_statisticsStoreClassName = YES;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_sessionStoreClassName = NO;
static NSString *_dflt_sessionStoreClassName = nil;
@ -1449,30 +1496,6 @@ static NSString *_dflt_recordingClassName = nil;
return recordingClass;
};
//--------------------------------------------------------------------
static BOOL _dflt_init_sessionTimeOut = NO;
static NSNumber *_dflt_sessionTimeOut = nil;
+(void)setSessionTimeOut:(NSNumber*)aTimeOut
{
LOGClassFnStart();
NSDebugMLLog(@"sessions",@"aTimeOut=%@",aTimeOut);
ASSIGNCOPY(_dflt_sessionTimeOut, aTimeOut);
_dflt_init_sessionTimeOut = YES;
LOGClassFnStop();
};
//--------------------------------------------------------------------
+(NSNumber*)sessionTimeOut
{
LOGClassFnStart();
INIT_DFLT_OBJ(sessionTimeOut,
GSWOPT_SessionTimeOut[GSWebNamingConv]);
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",
_dflt_sessionTimeOut);
LOGClassFnStop();
return _dflt_sessionTimeOut;
};
//--------------------------------------------------------------------
+(void)setSessionTimeOutValue:(NSTimeInterval)aTimeOutValue
{

View file

@ -144,6 +144,8 @@ GSWEB_EXPORT BOOL WOStrictFlag;
-(void)unlockRequestHandling;
-(void)lockRequestHandling;
-(NSString*)defaultRequestHandlerClassName;
-(Class)defaultRequestHandlerClass;
@end
//====================================================================
@ -464,6 +466,7 @@ GSWEB_EXPORT BOOL WOStrictFlag;
-(void)_setTracingAspect:(id)unknwon
enabled:(BOOL)enabled;
-(void)debugAdaptorThreadExited;
@end
//====================================================================
@ -563,8 +566,6 @@ GSWEB_EXPORT BOOL WOStrictFlag;
+(void)setLoadFrameworks:(NSArray*)frameworks;
+(BOOL)isDebuggingEnabled;
+(void)setDebuggingEnabled:(BOOL)flag;
+(BOOL)isStatusDebuggingEnabled;//NDFN
+(void)setStatusDebuggingEnabled:(BOOL)flag;//NDFN
+(BOOL)autoOpenInBrowser;
+(void)setAutoOpenInBrowser:(BOOL)flag;
+(BOOL)isDirectConnectEnabled;
@ -579,18 +580,8 @@ GSWEB_EXPORT BOOL WOStrictFlag;
+(void)setFrameworksBaseURL:(NSString*)baseURL;
+(NSString*)recordingPath;
+(void)setRecordingPath:(NSString*)path;
+(NSString*)outputPath;
+(void)setOutputPath:(NSString*)path;
+(NSArray*)projectSearchPath;
+(void)setProjectSearchPath:(NSArray*)pathArray;
+(BOOL)isLifebeatEnabled;
+(void)setLifebeatEnabled:(BOOL)flag;
+(NSString*)lifebeatDestinationHost;
+(void)setLifebeatDestinationHost:(NSString*)host;
+(int)lifebeatDestinationPort;
+(void)setLifebeatDestinationPort:(int)port;
+(NSTimeInterval)lifebeatInterval;
+(void)setLifebeatInterval:(NSTimeInterval)interval;
+(BOOL)isMonitorEnabled;
+(void)setMonitorEnabled:(BOOL)flag;
+(NSString*)monitorHost;
@ -601,18 +592,10 @@ GSWEB_EXPORT BOOL WOStrictFlag;
+(void)setAdaptor:(NSString*)adaptorName;
+(NSNumber*)port;
+(void)setPort:(NSNumber*)port;
+(int)intPort;
+(void)setIntPort:(int)port;
+(NSString*)host;
+(void)setHost:(NSString*)host;
+(id)listenQueueSize;
+(void)setListenQueueSize:(id)aSize;
+(id)workerThreadCount;
+(void)setWorkerThreadCount:(id)workerThreadCount;
+(id)workerThreadCountMin;
+(void)setWorkerThreadCountMin:(id)workerThreadCount;
+(id)workerThreadCountMax;
+(void)setWorkerThreadCountMax:(id)workerThreadCount;
+(NSArray*)additionalAdaptors;
+(void)setAdditionalAdaptors:(NSArray*)adaptorList;
+(BOOL)includeCommentsInResponses;
@ -621,35 +604,59 @@ GSWEB_EXPORT BOOL WOStrictFlag;
+(void)setComponentRequestHandlerKey:(NSString*)aKey;
+(NSString*)directActionRequestHandlerKey;
+(void)setDirectActionRequestHandlerKey:(NSString*)aKey;
+(NSString*)streamActionRequestHandlerKey;
+(void)setStreamActionRequestHandlerKey:(NSString*)aKey;
+(NSString*)resourceRequestHandlerKey;
+(void)setResourceRequestHandlerKey:(NSString*)aKey;
+(NSString*)statisticsStoreClassName;
+(void)setStatisticsStoreClassName:(NSString*)name;
+(void)setSessionTimeOut:(NSNumber*)aTimeOut;
+(NSNumber*)sessionTimeOut;
@end
//====================================================================
@interface GSWApplication (GSWUserDefaults)
+(BOOL)isStatusDebuggingEnabled;//NDFN
+(void)setStatusDebuggingEnabled:(BOOL)flag;//NDFN
+(BOOL)isStatusLoggingEnabled;//NDFN
+(void)setStatusLoggingEnabled:(BOOL)flag;//NDFN
+(NSString*)outputPath;
+(void)setOutputPath:(NSString*)path;
+(BOOL)isLifebeatEnabled;
+(void)setLifebeatEnabled:(BOOL)flag;
+(NSString*)lifebeatDestinationHost;
+(void)setLifebeatDestinationHost:(NSString*)host;
+(int)lifebeatDestinationPort;
+(void)setLifebeatDestinationPort:(int)port;
+(NSTimeInterval)lifebeatInterval;
+(void)setLifebeatInterval:(NSTimeInterval)interval;
+(int)intPort;
+(void)setIntPort:(int)port;
+(NSString*)host;
+(void)setHost:(NSString*)host;
+(id)workerThreadCountMin;
+(void)setWorkerThreadCountMin:(id)workerThreadCount;
+(id)workerThreadCountMax;
+(void)setWorkerThreadCountMax:(id)workerThreadCount;
+(NSString*)streamActionRequestHandlerKey;
+(void)setStreamActionRequestHandlerKey:(NSString*)aKey;
+(NSString*)pingActionRequestHandlerKey;
+(void)setPingActionRequestHandlerKey:(NSString*)aKey;
+(NSString*)staticResourceRequestHandlerKey;
+(void)setStaticResourceRequestHandlerKey:(NSString*)aKey;
-(NSString*)defaultRequestHandlerClassName;
-(Class)defaultRequestHandlerClass;
+(NSString*)resourceManagerClassName;
+(void)setResourceManagerClassName:(NSString*)name;
+(NSString*)statisticsStoreClassName;
+(void)setStatisticsStoreClassName:(NSString*)name;
+(NSString*)sessionStoreClassName;
+(void)setSessionStoreClassName:(NSString*)name;
+(NSString*)recordingClassName;
+(void)setRecordingClassName:(NSString*)name;
+(Class)recordingClass;
+(void)setSessionTimeOut:(NSNumber*)aTimeOut;
+(NSNumber*)sessionTimeOut;
+(void)setSessionTimeOutValue:(NSTimeInterval)aTimeOutValue;
+(NSTimeInterval)sessionTimeOutValue;
+(NSString*)debugSetConfigFilePath;//NDFN
+(void)setDebugSetConfigFilePath:(NSString*)debugSetConfigFilePath;//NDFN
+(void)setDefaultUndoStackLimit:(int)limit;
+(int)defaultUndoStackLimit;
+(BOOL)_lockDefaultEditingContext;
+(void)_setLockDefaultEditingContext:(BOOL)flag;
+(void)setDebugSetConfigFilePath:(NSString*)debugSetConfigFilePath;//NDFN
+(NSString*)acceptedContentEncoding;
+(NSArray*)acceptedContentEncodingArray;
+(void)setAcceptedContentEncoding:(NSString*)acceptedContentEncoding;

View file

@ -76,6 +76,10 @@ application unlock
- (void)_setPool:(NSAutoreleasePool *)pool;
@end
#define GSWFPutSL(string, file) \
do { fputs([string lossyCString],file); fputs("\n",file); fflush(file); } \
while (0)
/* GSWApplication+Defaults.m */
/* These functions should actually be static inline to limit thier scope
but that would mean that they have to be part of this transalation unit. */
@ -899,6 +903,24 @@ int GSWApplicationMain(NSString* applicationClassName,
};
//--------------------------------------------------------------------
-(NSString*)defaultRequestHandlerClassName
{
return @"GSWComponentRequestHandle";
};
//--------------------------------------------------------------------
-(Class)defaultRequestHandlerClass
{
Class defaultRequestHandlerClass=Nil;
NSString* className=[self defaultRequestHandlerClassName];
if ([className length]>0)
{
defaultRequestHandlerClass=NSClassFromString(className);
};
return defaultRequestHandlerClass;
};
@end
//====================================================================
@ -1192,7 +1214,8 @@ int GSWApplicationMain(NSString* applicationClassName,
#endif
};
#ifdef DEBUG
NSDebugMLLog(@"application",@"%s componentDefinition (%p) for %@ class=%@ %s. search time: %.3f s",
NSDebugMLLog(@"application",
@"%s componentDefinition (%p) for %@ class=%@ %s. search time: %.3f s",
(componentDefinition ? "FOUND" : "NOTFOUND"),
componentDefinition,
aName,
@ -2335,7 +2358,7 @@ to another instance **/
[someAssociations associationsSetDebugEnabled];
elementClass=NSClassFromString(aName);
NSDebugMLLog(@"info",@"elementClass %p:%@",elementClass,elementClass);
NSDebugMLLog(@"info",@"elementClass superClass:%@",[elementClass superClass]);
NSDebugMLLog(@"info",@"elementClass superclass:%@",[elementClass superclass]);
if (elementClass && !ClassIsKindOfClass(elementClass,[GSWComponent class]))
{
NSDebugMLLog(@"info",@"CREATE Element of Class %p:%@",aName,aName);
@ -3337,9 +3360,7 @@ to another instance **/
{
if ([[self class]isDebuggingEnabled])
{
fputs([aString cString],stderr);
fputs("\n",stderr);
fflush(stderr);
GSWFPutSL(aString,stderr);
};
};
@ -3403,9 +3424,7 @@ to another instance **/
//--------------------------------------------------------------------
-(void)logString:(NSString*)aString
{
fputs([aString lossyCString],stderr);
fputs("\n",stderr);
fflush(stderr);
GSWFPutSL(aString,stderr);
};
//--------------------------------------------------------------------
@ -3446,16 +3465,8 @@ to another instance **/
//--------------------------------------------------------------------
-(void)logErrorString:(NSString*)aString
{
const char* cString=NULL;
cString=[aString lossyCString];
fputs(cString,stderr);
fputs("\n",stderr);
fflush(stderr);
#ifndef NDEBUG
fputs(cString,stdout);
fputs("\n",stdout);
fflush(stdout);
#endif
GSWFPutSL(aString,stderr);
GSWFPutSL(aString,stdout);
};
//--------------------------------------------------------------------
@ -3619,6 +3630,17 @@ to another instance **/
aValue];
};
/**
* This method is called when a request loop has finished. You can override
* this method to inspect your process (e.g. for memory leaks). You should
* create an NSAutoreleasePool at the beginning of your method and release
* it at the end if you plan to use the implementation long running production
* envirnment analysis. This method is a GSWeb extension. The default
* implementation does nothing.
*/
-(void)debugAdaptorThreadExited
{
}
@end
//====================================================================
@ -3630,9 +3652,7 @@ to another instance **/
{
if ([[self class]isStatusDebuggingEnabled])
{
fputs([aString cString],stdout);
fputs("\n",stdout);
fflush(stdout);
GSWFPutSL(aString,stdout);
[self debugWithString:aString];
};
};
@ -3641,124 +3661,153 @@ to another instance **/
-(void)statusDebugWithFormat:(NSString*)aFormat
arguments:(va_list)arguments
{
NSString* string=[NSString stringWithFormat:aFormat
arguments:arguments];
[self statusDebugWithString:string];
if ([[self class]isStatusDebuggingEnabled])
{
NSString* string=[NSString stringWithFormat:aFormat
arguments:arguments];
[self statusDebugWithString:string];
}
};
//--------------------------------------------------------------------
-(void)statusDebugWithFormat:(NSString*)aFormat,...
{
va_list ap;
va_start(ap,aFormat);
[self statusDebugWithFormat:aFormat
arguments:ap];
va_end(ap);
if ([[self class]isStatusDebuggingEnabled])
{
va_list ap;
va_start(ap,aFormat);
[self statusDebugWithFormat:aFormat
arguments:ap];
va_end(ap);
}
};
//--------------------------------------------------------------------
+(void)statusDebugWithFormat:(NSString*)aFormat,...
{
va_list ap;
va_start(ap,aFormat);
[GSWApp statusDebugWithFormat:aFormat
arguments:ap];
va_end(ap);
if ([[self class]isStatusDebuggingEnabled])
{
va_list ap;
va_start(ap,aFormat);
[GSWApp statusDebugWithFormat:aFormat
arguments:ap];
va_end(ap);
}
};
//--------------------------------------------------------------------
-(void)statusLogString:(NSString*)aString
{
fputs([aString lossyCString],stdout);
fputs("\n",stdout);
fflush(stdout);
[self logString:aString];
if ([[self class]isStatusDebuggingEnabled])
{
GSWFPutSL(aString,stdout);
[self logString:aString];
}
};
//--------------------------------------------------------------------
+(void)statusLogString:(NSString*)aString
{
[GSWApp statusLogString:aString];
if ([[self class]isStatusLoggingEnabled])
{
[GSWApp statusLogString:aString];
}
};
//--------------------------------------------------------------------
-(void)statusLogWithFormat:(NSString*)aFormat,...
{
va_list ap;
va_start(ap,aFormat);
[self statusLogWithFormat:aFormat
arguments:ap];
va_end(ap);
if ([[self class]isStatusLoggingEnabled])
{
va_list ap;
va_start(ap,aFormat);
[self statusLogWithFormat:aFormat
arguments:ap];
va_end(ap);
}
};
//--------------------------------------------------------------------
+(void)statusLogWithFormat:(NSString*)aFormat,...
{
va_list ap;
va_start(ap,aFormat);
[GSWApp statusLogWithFormat:aFormat
arguments:ap];
va_end(ap);
if ([[self class]isStatusLoggingEnabled])
{
va_list ap;
va_start(ap,aFormat);
[GSWApp statusLogWithFormat:aFormat
arguments:ap];
va_end(ap);
}
};
//--------------------------------------------------------------------
-(void)statusLogWithFormat:(NSString*)aFormat
arguments:(va_list)arguments
{
NSString* string=[NSString stringWithFormat:aFormat
arguments:arguments];
[self statusLogString:string];
if ([[self class]isStatusLoggingEnabled])
{
NSString* string=[NSString stringWithFormat:aFormat
arguments:arguments];
[self statusLogString:string];
}
};
//--------------------------------------------------------------------
-(void)statusLogErrorWithFormat:(NSString*)aFormat,...
{
va_list ap;
va_start(ap,aFormat);
[self statusLogErrorWithFormat:aFormat
arguments:ap];
va_end(ap);
if ([[self class]isStatusLoggingEnabled])
{
va_list ap;
va_start(ap,aFormat);
[self statusLogErrorWithFormat:aFormat
arguments:ap];
va_end(ap);
}
};
//--------------------------------------------------------------------
+(void)statusLogErrorWithFormat:(NSString*)aFormat,...
{
va_list ap;
va_start(ap,aFormat);
[GSWApp statusLogErrorWithFormat:aFormat
arguments:ap];
va_end(ap);
if ([[self class]isStatusLoggingEnabled])
{
va_list ap;
va_start(ap,aFormat);
[GSWApp statusLogErrorWithFormat:aFormat
arguments:ap];
va_end(ap);
}
};
//--------------------------------------------------------------------
-(void)statusLogErrorWithFormat:(NSString*)aFormat
arguments:(va_list)arguments
{
const char* cString=NULL;
NSString* string=[NSString stringWithFormat:aFormat
arguments:arguments];
cString=[string cString];
fputs(cString,stdout);
fputs("\n",stdout);
fflush(stdout);
[self logErrorWithFormat:@"%@",string];
if ([[self class]isStatusLoggingEnabled])
{
NSString* string=[NSString stringWithFormat:aFormat
arguments:arguments];
GSWFPutSL(string,stdout);
[self logErrorWithFormat:@"%@",string];
}
};
//--------------------------------------------------------------------
-(void)statusLogErrorString:(NSString*)aString
{
const char* cString=NULL;
cString=[aString lossyCString];
fputs(cString,stdout);
fputs("\n",stdout);
fflush(stdout);
[self logErrorString:aString];
if ([[self class]isStatusLoggingEnabled])
{
GSWFPutSL(aString,stdout);
[self logErrorString:aString];
}
};
//--------------------------------------------------------------------
+(void)statusLogErrorString:(NSString*)aString
{
[GSWApp statusLogErrorString:aString];
if ([[self class]isStatusLoggingEnabled])
{
[GSWApp statusLogErrorString:aString];
}
};
@end

View file

@ -682,11 +682,15 @@ objectForReference:(NSString*)keyPath
if ([[GSWApplication application] isCachingEnabled])
{
if (template)
[_templateCache setObject:template
forKey:relativeTemplatePath];
{
[_templateCache setObject:template
forKey:relativeTemplatePath];
}
else
[_templateCache setObject:GSNotFoundMarker
forKey:relativeTemplatePath];
{
[_templateCache setObject:GSNotFoundMarker
forKey:relativeTemplatePath];
}
};
};
};

View file

@ -43,6 +43,7 @@
#define GSWOPTVALUE_CachingEnabled @"YES"
#define GSWOPTVALUE_DebuggingEnabled @"YES"
#define GSWOPTVALUE_StatusDebuggingEnabled @"YES"
#define GSWOPTVALUE_StatusLoggingEnabled @"YES"
#define GSWOPTVALUE_DirectConnectEnabled @"YES"
#define GSWOPTVALUE_FrameworksBaseURL @"/GSW/Frameworks"
#define GSWOPTVALUE_IncludeCommentsInResponse @"YES"

View file

@ -199,6 +199,7 @@ GSWEB_EXPORT NSString* GSWOPT_CachingEnabled[2];
GSWEB_EXPORT NSString* GSWOPT_ComponentRequestHandlerKey[2];
GSWEB_EXPORT NSString* GSWOPT_DebuggingEnabled[2];
GSWEB_EXPORT NSString* GSWOPT_StatusDebuggingEnabled[2];
GSWEB_EXPORT NSString* GSWOPT_StatusLoggingEnabled[2];
GSWEB_EXPORT NSString* GSWOPT_DirectActionRequestHandlerKey[2];
GSWEB_EXPORT NSString* GSWOPT_DirectConnectEnabled[2];
GSWEB_EXPORT NSString* GSWOPT_FrameworksBaseURL[2];

View file

@ -196,6 +196,7 @@ NSString* GSWOPT_CachingEnabled[2]={ @"GSWCachingEnabled", @"WOCachingEnabled" }
NSString* GSWOPT_ComponentRequestHandlerKey[2]={ @"GSWComponentRequestHandlerKey", @"WOComponentRequestHandlerKey" };
NSString* GSWOPT_DebuggingEnabled[2]={ @"GSWDebuggingEnabled", @"WODebuggingEnabled" };
NSString* GSWOPT_StatusDebuggingEnabled[2]={ @"GSWStatusDebuggingEnabled", @"WOStatusDebuggingEnabled" };//NDFN
NSString* GSWOPT_StatusLoggingEnabled[2]={ @"GSWStatusLoggingEnabled", @"WOStatusLoggingEnabled" };//NDFN
NSString* GSWOPT_DirectActionRequestHandlerKey[2]={ @"GSWDirectActionRequestHandlerKey", @"WODirectActionRequestHandlerKey" };
NSString* GSWOPT_PingActionRequestHandlerKey[2]={ @"GSWPingActionRequestHandlerKey", @"WOPingActionRequestHandlerKey" };
NSString* GSWOPT_StaticResourceRequestHandlerKey[2]={ @"GSWStaticResourceRequestHandlerKey", @"WOStaticResourceRequestHandlerKey" };

View file

@ -92,7 +92,7 @@ static NSData* lineFeedData=nil;
GSWLogMemC("release dates");
DESTROY(_remoteAddress);
GSWLogMemC("release pool");
// DESTROY(_pool);
DESTROY(_pool);
GSWLogMemC("super dealloc");
[super dealloc];
GSWLogMemC("dealloc GSWDefaultAdaptorThread end");
@ -134,6 +134,7 @@ static NSData* lineFeedData=nil;
NSDictionary* headers=nil;
NSData* data=nil;
DESTROY(_pool);
_pool=[NSAutoreleasePool new];
GSWLogMemCF("New NSAutoreleasePool: %p",_pool);
#ifdef GSWDEBUG_DEEP
@ -285,6 +286,7 @@ static NSData* lineFeedData=nil;
GSWLogMemCF("Will Destroy NSAutoreleasePool: %p",_pool);
[self setPool:nil
destroyLast:YES];
[GSWApp debugAdaptorThreadExited];
// LOGObjectFnStop();
GSWLogDeepC("threadExited");
};

View file

@ -135,6 +135,12 @@ static GSWHTMLRawParserTagType GetTagType(unichar* uniBuf,int length,int* indexP
return self;
}
-(void)dealloc
{
DESTROY(_delegate);
DESTROY(_string);
[super dealloc];
}
//--------------------------------------------------------------------
/** Called when finding a new dynamic tag or a new comment or at the
end of the string to record seen text parts

View file

@ -1629,7 +1629,7 @@ bundle if none is found
//--------------------------------------------------------------------
-(void)_validateAPI
{
//Verifier que self ne répond pas aux OldFN
//Verifier que self ne respond pas aux OldFN
LOGObjectFnNotImplemented(); //TODOFN
};