mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-04-23 23:48:46 +00:00
2000-03-20 Manuel Guesdon <mguesdon@sbuilders.com>
* GSWDebug.h: remove unused functions * GSWApplication.h/.m:Added: GSWDebuggingStatus category +isStatusDebuggingEnabled +setStatusDebuggingEnabled: +debugSetConfigFilePath +setDebugSetConfigFilePath: * GSWApplication.h/.m: replaced GSWDebugStdLog by [GSWApp statusDebug...] replaced executeWithClasses: with executeWithClassArray: corrections for different warnings change in GSWApplicationDebugSetChange() to use GSWDebugSetConfigFi lePath option * GSWConfig.h: added GSWOPTVALUE_StatusDebuggingEnabled * GSWConstants.h/.m: added GSWOPT_StatusDebuggingEnabled added GSWOPT_DebugSetConfigFilePath * INSTALL: reflect changes of adaptors,... * GSWUtil.h/.m: corrections for different warnings removed MD5HexDigest() * GSWCheckBoxListm: replaced LOGAssertGood by GSWLogAssertGood * GSWRadioButtonList.m: replaced LOGAssertGood by GSWLogAssertGood * GSWDefaultAdaptorThread.m: replaced GSWLogCStdOut by +statusLogWithFormat : corrections for different warnings * GSWDefaultAdaptor.m: replaced GSWLogCStdOut by +statusLogWithFormat: * GSWSessionTimeOutManager.m: replaced GSWLogCStdOut by +statusLogWithForma t: * GSWKeyValueAssociation.m: replaced LOGAssertGood by GSWLogAssertGood * GSWHTMLStaticElement.m: corrections for different warnings * GSWConstantValueAssociation.m: replaced LOGAssertGood by GSWLogAssertGood * GSWHTMLDynamicElement.m: corrections for different warnings * GSWStatsPage.m: corrections for different warnings * GSWExceptionPage.m: removed GSWLogCStdOut calls * GSWSession.m: replaced GSWLogCStdOut by +statusLogWithFormat: replaced LOGAssertGood by GSWLogAssertGood * GSWAssociation.m: replaced LOGAssertGood by GSWLogAssertGood * GSWComponent.m: replaced LOGAssertGood by GSWLogAssertGood * GSWContext.m: replaced LOGAssertGood by GSWLogAssertGood * GSWRequest.m: replaced LOGAssertGood by GSWLogAssertGood * GSWResponse.m: replaced LOGAssertGood by GSWLogAssertGood * GSWSessionStore.m: replaced LOGAssertGood by GSWLogAssertGood * Adator GSWAppRequest.c: test on instance in GSWAppRequest_SendAppRequestT oApp * Adator GSWLoadBalancing.c: added debug messages * Adaptor GSWHTTPRequest.c: corrected bug in GSWHTTPRequest_SendRequest * Adaptor: GSWAppConnectSocket.c: added debug messages * GSWeb.framework/Makefile.preamble: removed -lNGReflection git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@6345 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f9ecb43b28
commit
ce2a032367
37 changed files with 557 additions and 707 deletions
45
ChangeLog
45
ChangeLog
|
@ -1,3 +1,48 @@
|
|||
2000-03-20 Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
|
||||
* GSWDebug.h: remove unused functions
|
||||
* GSWApplication.h/.m:Added:
|
||||
GSWDebuggingStatus category
|
||||
+isStatusDebuggingEnabled
|
||||
+setStatusDebuggingEnabled:
|
||||
+debugSetConfigFilePath
|
||||
+setDebugSetConfigFilePath:
|
||||
* GSWApplication.h/.m: replaced GSWDebugStdLog by [GSWApp statusDebug...]
|
||||
replaced executeWithClasses: with executeWithClassArray:
|
||||
corrections for different warnings
|
||||
change in GSWApplicationDebugSetChange() to use GSWDebugSetConfigFilePath option
|
||||
* GSWConfig.h: added GSWOPTVALUE_StatusDebuggingEnabled
|
||||
* GSWConstants.h/.m: added GSWOPT_StatusDebuggingEnabled
|
||||
added GSWOPT_DebugSetConfigFilePath
|
||||
* INSTALL: reflect changes of adaptors,...
|
||||
* GSWUtil.h/.m: corrections for different warnings
|
||||
removed MD5HexDigest()
|
||||
* GSWCheckBoxListm: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWRadioButtonList.m: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWDefaultAdaptorThread.m: replaced GSWLogCStdOut by +statusLogWithFormat:
|
||||
corrections for different warnings
|
||||
* GSWDefaultAdaptor.m: replaced GSWLogCStdOut by +statusLogWithFormat:
|
||||
* GSWSessionTimeOutManager.m: replaced GSWLogCStdOut by +statusLogWithFormat:
|
||||
* GSWKeyValueAssociation.m: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWHTMLStaticElement.m: corrections for different warnings
|
||||
* GSWConstantValueAssociation.m: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWHTMLDynamicElement.m: corrections for different warnings
|
||||
* GSWStatsPage.m: corrections for different warnings
|
||||
* GSWExceptionPage.m: removed GSWLogCStdOut calls
|
||||
* GSWSession.m: replaced GSWLogCStdOut by +statusLogWithFormat:
|
||||
replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWAssociation.m: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWComponent.m: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWContext.m: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWRequest.m: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWResponse.m: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* GSWSessionStore.m: replaced LOGAssertGood by GSWLogAssertGood
|
||||
* Adator GSWAppRequest.c: test on instance in GSWAppRequest_SendAppRequestToApp
|
||||
* Adator GSWLoadBalancing.c: added debug messages
|
||||
* Adaptor GSWHTTPRequest.c: corrected bug in GSWHTTPRequest_SendRequest
|
||||
* Adaptor: GSWAppConnectSocket.c: added debug messages
|
||||
* GSWeb.framework/Makefile.preamble: removed -lNGReflection
|
||||
|
||||
2000-03-16 Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
|
||||
* All Files in GSWAdaptors: Clean code, changes in config file,...
|
||||
|
|
|
@ -51,6 +51,9 @@ typedef STAppConnectSocket* AppConnectSocketHandle;
|
|||
AppConnectHandle GSWApp_Open(GSWAppRequest* p_pAppRequest,void* p_pLogServerData)
|
||||
{
|
||||
AppConnectHandle handle=NULL;
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Start GSWApp_Open");
|
||||
#endif
|
||||
if (!p_pAppRequest)
|
||||
{
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,
|
||||
|
@ -144,21 +147,30 @@ AppConnectHandle GSWApp_Open(GSWAppRequest* p_pAppRequest,void* p_pLogServerData
|
|||
};
|
||||
};
|
||||
};
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Stop GSWApp_Open");
|
||||
#endif
|
||||
return handle;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void GSWApp_Close(AppConnectHandle p_handle,void* p_pLogServerData)
|
||||
{
|
||||
/*
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_ERROR,p_pLogServerData,"GSWApp_Close Start");
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Start GSWApp_Close ");
|
||||
#endif
|
||||
*/
|
||||
if (p_handle)
|
||||
if (!p_handle)
|
||||
{
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_Close: no Handle !");
|
||||
}
|
||||
else
|
||||
{
|
||||
AppConnectSocketHandle handle=(AppConnectSocketHandle)p_handle;
|
||||
if (handle->iSocketDescr)
|
||||
if (!handle->iSocketDescr)
|
||||
{
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_Close: no socket desc !");
|
||||
}
|
||||
else
|
||||
{
|
||||
close(handle->iSocketDescr);
|
||||
fclose(handle->pFileRead);
|
||||
|
@ -166,35 +178,49 @@ void GSWApp_Close(AppConnectHandle p_handle,void* p_pLogServerData)
|
|||
};
|
||||
free(handle);
|
||||
};
|
||||
/*
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_ERROR,p_pLogServerData,"GSWApp_Close Stop");
|
||||
GSWLog(GSW_ERROR,p_pLogServerData,"Stop GSWApp_Close");
|
||||
#endif
|
||||
*/
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
int GSWApp_SendLine(AppConnectHandle p_handle, CONST char* p_pszBuffer,void* p_pLogServerData)
|
||||
{
|
||||
int iRetValue=-1;
|
||||
if (p_handle)
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Start GSWApp_SendLine");
|
||||
#endif
|
||||
if (!p_handle)
|
||||
{
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_SendLine: no Handle !");
|
||||
}
|
||||
else
|
||||
{
|
||||
AppConnectSocketHandle handle=(AppConnectSocketHandle)p_handle;
|
||||
if (fputs(p_pszBuffer,handle->pFileWrite)!=EOF)
|
||||
if (!handle->pFileWrite)
|
||||
{
|
||||
fflush(handle->pFileWrite);
|
||||
iRetValue=0;
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_SendLine: no write file handle !");
|
||||
}
|
||||
else
|
||||
{
|
||||
GSWLog(GSW_ERROR,
|
||||
p_pLogServerData,
|
||||
"GSWApp_SendLine failed. Error=%d (%s)",
|
||||
errno,
|
||||
strerror(errno));
|
||||
iRetValue=-1;
|
||||
if (fputs(p_pszBuffer,handle->pFileWrite)!=EOF)
|
||||
{
|
||||
fflush(handle->pFileWrite);
|
||||
iRetValue=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
GSWLog(GSW_ERROR,
|
||||
p_pLogServerData,
|
||||
"GSWApp_SendLine failed. Error=%d (%s)",
|
||||
errno,
|
||||
strerror(errno));
|
||||
};
|
||||
};
|
||||
};
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Stop GSWApp_SendLine");
|
||||
#endif
|
||||
return iRetValue;
|
||||
};
|
||||
|
||||
|
@ -207,24 +233,39 @@ int GSWApp_SendBlock(AppConnectHandle p_handle,
|
|||
{
|
||||
int iRetValue=-1;
|
||||
int iBytesSent=0;
|
||||
if (p_handle)
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Start GSWApp_SendBlock");
|
||||
#endif
|
||||
if (!p_handle)
|
||||
{
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_SendBlock: no Handle !");
|
||||
}
|
||||
else
|
||||
{
|
||||
AppConnectSocketHandle handle=(AppConnectSocketHandle)p_handle;
|
||||
iBytesSent = fwrite(p_pszBuffer,sizeof(char),p_iSize,handle->pFileWrite);
|
||||
fflush(handle->pFileWrite);
|
||||
|
||||
if (iBytesSent<0)
|
||||
if (!handle->pFileWrite)
|
||||
{
|
||||
GSWLog(GSW_ERROR,
|
||||
p_pLogServerData,
|
||||
"send failed. Error=%d (%s)",
|
||||
errno,
|
||||
strerror(errno));
|
||||
iRetValue=-1;
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_SendBlock: no write file handle !");
|
||||
}
|
||||
else
|
||||
iRetValue=0;
|
||||
{
|
||||
iBytesSent = fwrite(p_pszBuffer,sizeof(char),p_iSize,handle->pFileWrite);
|
||||
fflush(handle->pFileWrite);
|
||||
if (iBytesSent<0)
|
||||
{
|
||||
GSWLog(GSW_ERROR,
|
||||
p_pLogServerData,
|
||||
"send failed. Error=%d (%s)",
|
||||
errno,
|
||||
strerror(errno));
|
||||
}
|
||||
else
|
||||
iRetValue=0;
|
||||
};
|
||||
};
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Stop GSWApp_SendBlock");
|
||||
#endif
|
||||
return iRetValue;
|
||||
};
|
||||
|
||||
|
@ -235,20 +276,36 @@ int GSWApp_ReceiveLine(AppConnectHandle p_handle,
|
|||
void* p_pLogServerData)
|
||||
{
|
||||
int iRetValue=-1;
|
||||
if (p_handle)
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Start GSWApp_ReceiveLine");
|
||||
#endif
|
||||
*p_pszBuffer=0;
|
||||
if (!p_handle)
|
||||
{
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_ReceiveLine: no Handle !");
|
||||
}
|
||||
else
|
||||
{
|
||||
AppConnectSocketHandle handle=(AppConnectSocketHandle)p_handle;
|
||||
char* pszLine=fgets(p_pszBuffer,p_iBufferSize,handle->pFileRead);
|
||||
if (pszLine)
|
||||
if (!handle->pFileRead)
|
||||
{
|
||||
iRetValue=DeleteTrailingCRNL(p_pszBuffer);
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_ReceiveLine: no read file handle !");
|
||||
}
|
||||
else
|
||||
{
|
||||
*p_pszBuffer=0;
|
||||
iRetValue=-1; //??
|
||||
char* pszLine=fgets(p_pszBuffer,p_iBufferSize,handle->pFileRead);
|
||||
if (pszLine)
|
||||
{
|
||||
iRetValue=DeleteTrailingCRNL(p_pszBuffer);
|
||||
}
|
||||
else
|
||||
*p_pszBuffer=0;
|
||||
};
|
||||
};
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"GSWApp_ReceiveLine line=[%s]",p_pszBuffer);
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Stop GSWApp_ReceiveLine");
|
||||
#endif
|
||||
return iRetValue;
|
||||
};
|
||||
|
||||
|
@ -259,11 +316,28 @@ int GSWApp_ReceiveBlock(AppConnectHandle p_handle,
|
|||
void* p_pLogServerData)
|
||||
{
|
||||
int iRetValue=-1;
|
||||
if (p_handle)
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Start GSWApp_ReceiveBlock");
|
||||
#endif
|
||||
if (!p_handle)
|
||||
{
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_ReceiveBlock: no Handle !");
|
||||
}
|
||||
else
|
||||
{
|
||||
AppConnectSocketHandle handle=(AppConnectSocketHandle)p_handle;
|
||||
iRetValue=fread(p_pszBuffer,sizeof(char),p_iBufferSize,handle->pFileRead);
|
||||
if (!handle->pFileRead)
|
||||
{
|
||||
GSWLog(GSW_CRITICAL,p_pLogServerData,"GSWApp_ReceiveBlock: no read file handle !");
|
||||
}
|
||||
else
|
||||
{
|
||||
iRetValue=fread(p_pszBuffer,sizeof(char),p_iBufferSize,handle->pFileRead);
|
||||
};
|
||||
};
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Stop GSWApp_ReceiveBlock");
|
||||
#endif
|
||||
return iRetValue;
|
||||
};
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ GSWHTTPResponse* GSWAppRequest_SendAppRequestToApp(GSWHTTPRequest** p_ppHTTPRequ
|
|||
AppConnectHandle hConnect=NULL;
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Start GSWAppRequest_SendAppRequestToApp");
|
||||
|
||||
if (p_pAppRequest->iInstance)
|
||||
if (p_pAppRequest->iInstance>0) //-1 or 0 mean any instance
|
||||
fAppFound = GSWLoadBalancing_FindInstance(p_pAppRequest,p_pLogServerData);
|
||||
else
|
||||
fAppFound = GSWLoadBalancing_FindApp(p_pAppRequest,p_pLogServerData);
|
||||
|
|
|
@ -233,13 +233,20 @@ BOOL GSWHTTPRequest_SendRequest(GSWHTTPRequest* p_pHTTPRequest,AppConnectHandle
|
|||
GSWLog(GSW_DEBUG,p_pLogServerData,"Start GSWHTTPRequest_SendRequest");
|
||||
iRequestLength = strlen(p_pHTTPRequest->pszRequest);
|
||||
iContentLength = p_pHTTPRequest->uContentLength;
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Request:%s",p_pHTTPRequest->pszRequest);
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"iContentLength:%d",iContentLength);
|
||||
#endif
|
||||
|
||||
GSWDict_PerformForAllElem(p_pHTTPRequest->pHeaders,
|
||||
GetHeaderLength,
|
||||
&iHeaderLength);
|
||||
iHeaderLength++; // Last /n
|
||||
|
||||
iLength=iRequestLength+iHeaderLength+iContentLength;
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"iHeaderLength:%d",iHeaderLength);
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"iLength:%d",iLength);
|
||||
#endif
|
||||
|
||||
pszBuffer = malloc(iLength+1);
|
||||
|
||||
|
@ -261,11 +268,15 @@ BOOL GSWHTTPRequest_SendRequest(GSWHTTPRequest* p_pHTTPRequest,AppConnectHandle
|
|||
};
|
||||
|
||||
GSWLog(GSW_INFO,p_pLogServerData,
|
||||
"Sending AppRequest Content: %s\n(iContentLength Bytes)",
|
||||
"Sending AppRequest Content: %s\n(%d Bytes)",
|
||||
p_pHTTPRequest->pszRequest,
|
||||
iContentLength);
|
||||
// Just To be sure of the length
|
||||
iLength = pszTmp - pszBuffer;
|
||||
#ifdef DEBUG
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"pszBuffer:%s",pszBuffer);
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"iLength:%d",iLength);
|
||||
#endif
|
||||
fOk = GSWApp_SendBlock(p_socket,pszBuffer,iLength,p_pLogServerData);
|
||||
free(pszBuffer);
|
||||
pszBuffer=NULL;
|
||||
|
|
|
@ -137,15 +137,24 @@ BOOL GSWLoadBalancing_FindInstance(GSWAppRequest *p_pAppRequest,void* p_pLogServ
|
|||
char szInstanceNum[50]="";
|
||||
sprintf(szInstanceNum,"%d",p_pAppRequest->iInstance);
|
||||
pAppInstance=(GSWAppInstance*)GSWDict_ValueForKey(&pApp->stInstancesDict,szInstanceNum);
|
||||
if (pAppInstance && pAppInstance->fValid)
|
||||
if (pAppInstance)
|
||||
{
|
||||
fFound=TRUE;
|
||||
p_pAppRequest->iInstance = pAppInstance->iInstance;
|
||||
p_pAppRequest->pszHost = pAppInstance->pszHostName;
|
||||
p_pAppRequest->iPort = pAppInstance->iPort;
|
||||
p_pAppRequest->eType = EAppType_LoadBalanced;
|
||||
p_pAppRequest->pAppInstance = pAppInstance;
|
||||
pAppInstance->uOpenedRequestsNb++;
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Instance Found");
|
||||
if (pAppInstance->fValid)
|
||||
{
|
||||
fFound=TRUE;
|
||||
p_pAppRequest->iInstance = pAppInstance->iInstance;
|
||||
p_pAppRequest->pszHost = pAppInstance->pszHostName;
|
||||
p_pAppRequest->iPort = pAppInstance->iPort;
|
||||
p_pAppRequest->eType = EAppType_LoadBalanced;
|
||||
p_pAppRequest->pAppInstance = pAppInstance;
|
||||
pAppInstance->uOpenedRequestsNb++;
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Instance is valid");
|
||||
}
|
||||
else
|
||||
{
|
||||
GSWLog(GSW_DEBUG,p_pLogServerData,"Instance is not valid");
|
||||
};
|
||||
};
|
||||
};
|
||||
GSWLock_Unlock(g_lockAppList);
|
||||
|
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
#endif //_cplusplus
|
||||
|
||||
#define CONST const
|
||||
#define DEBUG 1
|
||||
#define DEBUG
|
||||
|
||||
#define GSWEB_SERVER_ADAPTOR_VERSION_MAJOR 1
|
||||
#define GSWEB_SERVER_ADAPTOR_VERSION_MAJOR_STRING "1"
|
||||
|
|
|
@ -28,16 +28,12 @@
|
|||
|
||||
-(void)dealloc
|
||||
{
|
||||
GSWLogCStdOut("Dealloc GSWExceptionPage\n");
|
||||
GSWLogC("Dealloc GSWExceptionPage\n");
|
||||
DESTROY(exception);
|
||||
GSWLogCStdOut("Dealloc GSWExceptionPage reasons\n");
|
||||
GSWLogC("Dealloc GSWExceptionPage reasons\n");
|
||||
DESTROY(reasons);
|
||||
GSWLogCStdOut("Dealloc GSWExceptionPage super\n");
|
||||
GSWLogC("Dealloc GSWExceptionPage super\n");
|
||||
[super dealloc];
|
||||
GSWLogCStdOut("Dealloc GSWExceptionPage end\n");
|
||||
GSWLogC("Dealloc GSWExceptionPage end\n");
|
||||
};
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
int _tmpCount=0;
|
||||
NSDictionary* _page = nil;
|
||||
NSEnumerator* _enum = [aDictionary objectEnumerator];
|
||||
while (_page = [_enum nextObject])
|
||||
while ((_page = [_enum nextObject]))
|
||||
{
|
||||
_tmpCount = [[_page objectForKey:@"Served"] intValue];
|
||||
_maxServedCount = max(_maxServedCount,_tmpCount);
|
||||
|
@ -67,7 +67,7 @@
|
|||
|
||||
-(id)_initIvars
|
||||
{
|
||||
id currentCount, i;
|
||||
id currentCount=nil;
|
||||
statsDict = [[self application] statistics];
|
||||
pagesDict = [statsDict objectForKey:@"Pages"];
|
||||
directActionsDict = [statsDict objectForKey:@"DirectActions"];
|
||||
|
@ -91,6 +91,7 @@
|
|||
|
||||
maxPageCount = [self _maxServedForDictionary:pagesDict];
|
||||
maxActionCount = [self _maxServedForDictionary:directActionsDict];
|
||||
return nil; //??? //TODO
|
||||
};
|
||||
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
|
|
|
@ -346,6 +346,7 @@ extern NSString* globalApplicationClassName;
|
|||
-(Class)libraryClassWithPath:(NSString*)path_;//NDFN
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWDebugging)
|
||||
-(void)debugWithString:(NSString*)_string;
|
||||
-(void)debugWithFormat:(NSString*)_format
|
||||
|
@ -398,6 +399,26 @@ extern NSString* globalApplicationClassName;
|
|||
enabled:(BOOL)_enabled;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
//NDFN
|
||||
//Same as GSWDebugging but it print messages on stdout AND call GSWDebugging methods
|
||||
@interface GSWApplication (GSWDebuggingStatus)
|
||||
|
||||
-(void)statusDebugWithString:(NSString*)string_;
|
||||
-(void)statusDebugWithFormat:(NSString*)format_
|
||||
arguments:(va_list)arguments_;
|
||||
-(void)statusDebugWithFormat:(NSString*)format_,...;
|
||||
+(void)statusDebugWithFormat:(NSString*)format_,...;
|
||||
-(void)statusLogWithFormat:(NSString*)format_,...;
|
||||
+(void)statusLogWithFormat:(NSString*)format_,...;
|
||||
-(void)statusLogWithFormat:(NSString*)format_
|
||||
arguments:(va_list)arguments_;
|
||||
-(void)statusLogErrorWithFormat:(NSString*)format_,...;
|
||||
+(void)statusLogErrorWithFormat:(NSString*)format_,...;
|
||||
-(void)statusLogErrorWithFormat:(NSString*)format_
|
||||
arguments:(va_list)arguments_;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplication (GSWStatisticsSupport)
|
||||
-(void)setStatisticsStore:(GSWStatisticsStore*)statisticsStore_;
|
||||
|
@ -447,6 +468,8 @@ extern NSString* globalApplicationClassName;
|
|||
+(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;
|
||||
|
@ -491,6 +514,8 @@ extern NSString* globalApplicationClassName;
|
|||
+(void)setResourceRequestHandlerKey:(NSString*)key_;
|
||||
+(void)setSessionTimeOut:(id)timeOut_;
|
||||
+(id)sessionTimeOut;
|
||||
+(NSString*)debugSetConfigFilePath;//NDFN
|
||||
+(void)setDebugSetConfigFilePath:(NSString*)debugSetConfigFilePath_;//NDFN
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
static char rcsId[] = "$Id$";
|
||||
|
||||
#include <gsweb/GSWeb.framework/GSWeb.h>
|
||||
#include <NGReflection/NGReflection.h>
|
||||
#include <extensions/NGReflection.h>
|
||||
#include <extensions/GarbageCollector.h>
|
||||
#include "stacktrace.h"
|
||||
#include "attach.h"
|
||||
|
@ -50,52 +50,16 @@ NSMutableDictionary* localDynCreateClassNames=nil;
|
|||
|
||||
#ifndef NDEBUG
|
||||
void GSWApplicationDebugSetChange()
|
||||
{/*
|
||||
static int state=-1;
|
||||
static NSSet* _mySet=nil;
|
||||
NSProcessInfo* _processInfo=[NSProcessInfo processInfo];
|
||||
NSMutableSet* _debugSet=[_processInfo debugSet];
|
||||
NSString* _newStateString=[NSString stringWithContentsOfFile:[NSString stringWithFormat:@"/tmp/%@.logstate",
|
||||
globalApplicationClassName]];
|
||||
NSDebugFLog(@"_debugSet=%@",_debugSet);
|
||||
NSDebugFLog(@"_newStateString=%@",_newStateString);
|
||||
if (_newStateString)
|
||||
{
|
||||
int _newState=[_newStateString intValue];
|
||||
NSDebugFLog(@"_newState=%d state=%d",_newState,state);
|
||||
if (_newState!=state)
|
||||
{
|
||||
if (_newState==0)
|
||||
{
|
||||
NSMutableSet* _newSet=[NSMutableSet setWithObjects:
|
||||
@"dflt",
|
||||
@"error",
|
||||
nil];
|
||||
DESTROY(_mySet);
|
||||
_mySet=[_debugSet copy];
|
||||
NSDebugFLog(@"_mySet=%@",_mySet);
|
||||
[_newSet intersectSet:_mySet];
|
||||
[_debugSet removeAllObjects];
|
||||
[_debugSet unionSet:_newSet];
|
||||
[_debugSet addObject:@"seriousError"];
|
||||
[_debugSet addObject:@"exception"];
|
||||
NSDebugFLog(@"_debugSet=%@",_debugSet);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSDebugFLog(@"_mySet=%@",_mySet);
|
||||
[_debugSet unionSet:_mySet];
|
||||
NSDebugFLog(@"_debugSet=%@",_debugSet);
|
||||
};
|
||||
state=_newState;
|
||||
};
|
||||
};*/
|
||||
{
|
||||
static NSString* _prevStateString=nil;
|
||||
NSProcessInfo* _processInfo=[NSProcessInfo processInfo];
|
||||
NSMutableSet* _debugSet=[_processInfo debugSet];
|
||||
NSString* _newStateString=[NSString stringWithContentsOfFile:[NSString stringWithFormat:@"/etc/gsweb/%@.logstate",
|
||||
globalApplicationClassName]];
|
||||
NSString* _debugSetConfigFilePath=nil;
|
||||
NSString* _newStateString=nil;
|
||||
BOOL _change=NO;
|
||||
_debugSetConfigFilePath=[GSWApplication debugSetConfigFilePath];
|
||||
NSLog(@"_debugSetConfigFilePath=%@",_debugSetConfigFilePath);
|
||||
_newStateString=[NSString stringWithContentsOfFile:[GSWApplication debugSetConfigFilePath]];
|
||||
NSLog(@"_debugSet=%@",_debugSet);
|
||||
NSDebugFLog(@"_debugSet=%@",_debugSet);
|
||||
NSLog(@"_newStateString=%@",_newStateString);
|
||||
|
@ -357,6 +321,7 @@ int GSWApplicationMain(NSString* _applicationClassName,
|
|||
GSWOPTVALUE_CachingEnabled, GSWOPT_CachingEnabled,
|
||||
GSWComponentRequestHandlerKey, GSWOPT_ComponentRequestHandlerKey,
|
||||
GSWOPTVALUE_DebuggingEnabled, GSWOPT_DebuggingEnabled,
|
||||
GSWOPTVALUE_StatusDebuggingEnabled, GSWOPT_StatusDebuggingEnabled,
|
||||
GSWDirectActionRequestHandlerKey, GSWOPT_DirectActionRequestHandlerKey,
|
||||
GSWOPTVALUE_DirectConnectEnabled, GSWOPT_DirectConnectEnabled,
|
||||
GSWOPTVALUE_FrameworksBaseURL, GSWOPT_FrameworksBaseURL,
|
||||
|
@ -800,7 +765,7 @@ int GSWApplicationMain(NSString* _applicationClassName,
|
|||
NSString* _path=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"bundles",@"[GSWResourceManager _applicationGSWBundle]:%@",[GSWResourceManager _applicationGSWBundle]);
|
||||
LOGDumpObject([GSWResourceManager _applicationGSWBundle],2);
|
||||
GSWLogDumpObject([GSWResourceManager _applicationGSWBundle],2);
|
||||
_path=[[GSWResourceManager _applicationGSWBundle] path]; //return : H:\Wotests\ObjCTest3
|
||||
NSDebugMLLog(@"low",@"_path:%@",_path);
|
||||
LOGObjectFnStop();
|
||||
|
@ -1104,18 +1069,16 @@ int GSWApplicationMain(NSString* _applicationClassName,
|
|||
};
|
||||
if (_componentDefinition)
|
||||
{
|
||||
NSString* _log=[NSString stringWithFormat:@"Component %@ %s language %@ (%sCached)",
|
||||
_name,
|
||||
(_language ? "" : "no"),
|
||||
(_language ? _language : @""),
|
||||
(isCachedComponent ? "" : "Not ")];
|
||||
GSWLogStdOut(_log);
|
||||
GSWLog(_log);
|
||||
[self statusDebugWithFormat:@"Component %@ %s language %@ (%sCached)",
|
||||
_name,
|
||||
(_language ? "" : "no"),
|
||||
(_language ? _language : @""),
|
||||
(isCachedComponent ? "" : "Not ")];
|
||||
};
|
||||
NSDebugMLLog(@"low",@"%s componentDefinition for %@ class=%@ %s",
|
||||
(_componentDefinition ? "FOUND" : "NOTFOUND"),
|
||||
_name,
|
||||
(_componentDefinition ? [_componentDefinition class] : @""),
|
||||
(_componentDefinition ? [[_componentDefinition class] description]: @""),
|
||||
(_componentDefinition ? (isCachedComponent ? "(Cached)" : "(Not Cached)") : ""));
|
||||
LOGObjectFnStop();
|
||||
return _componentDefinition;
|
||||
|
@ -2999,6 +2962,119 @@ int GSWApplicationMain(NSString* _applicationClassName,
|
|||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
//Same as GSWDebugging but it print messages on stdout AND call GSWDebugging methods
|
||||
@implementation GSWApplication (GSWDebuggingStatus)
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)statusDebugWithString:(NSString*)string_
|
||||
{
|
||||
if ([[self class]isStatusDebuggingEnabled])
|
||||
{
|
||||
fputs([string_ cString],stdout);
|
||||
fputs("\n",stdout);
|
||||
fflush(stdout);
|
||||
[self debugWithString:string_];
|
||||
};
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)statusDebugWithFormat:(NSString*)format_
|
||||
arguments:(va_list)arguments_
|
||||
{
|
||||
NSString* _string=[NSString stringWithFormat:format_
|
||||
arguments:arguments_];
|
||||
[self statusDebugWithString:_string];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)statusDebugWithFormat:(NSString*)format_,...
|
||||
{
|
||||
va_list ap=NULL;
|
||||
va_start(ap,format_);
|
||||
[self statusDebugWithFormat:format_
|
||||
arguments:ap];
|
||||
va_end(ap);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
+(void)statusDebugWithFormat:(NSString*)format_,...
|
||||
{
|
||||
va_list ap=NULL;
|
||||
va_start(ap,format_);
|
||||
[GSWApp statusDebugWithFormat:format_
|
||||
arguments:ap];
|
||||
va_end(ap);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)statusLogWithFormat:(NSString*)format_,...
|
||||
{
|
||||
va_list ap=NULL;
|
||||
va_start(ap,format_);
|
||||
[self statusLogWithFormat:format_
|
||||
arguments:ap];
|
||||
va_end(ap);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
+(void)statusLogWithFormat:(NSString*)format_,...
|
||||
{
|
||||
va_list ap=NULL;
|
||||
va_start(ap,format_);
|
||||
[GSWApp statusLogWithFormat:format_
|
||||
arguments:ap];
|
||||
va_end(ap);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)statusLogWithFormat:(NSString*)format_
|
||||
arguments:(va_list)arguments_
|
||||
{
|
||||
NSString* string=[NSString stringWithFormat:format_
|
||||
arguments:arguments_];
|
||||
fputs([string cString],stdout);
|
||||
fputs("\n",stdout);
|
||||
fflush(stdout);
|
||||
[self logWithFormat:@"%@",string];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)statusLogErrorWithFormat:(NSString*)format_,...
|
||||
{
|
||||
va_list ap=NULL;
|
||||
va_start(ap,format_);
|
||||
[self statusLogErrorWithFormat:format_
|
||||
arguments:ap];
|
||||
va_end(ap);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
+(void)statusLogErrorWithFormat:(NSString*)format_,...
|
||||
{
|
||||
va_list ap=NULL;
|
||||
va_start(ap,format_);
|
||||
[GSWApp statusLogErrorWithFormat:format_
|
||||
arguments:ap];
|
||||
va_end(ap);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)statusLogErrorWithFormat:(NSString*)format_
|
||||
arguments:(va_list)arguments_
|
||||
{
|
||||
const char* cString=NULL;
|
||||
NSString* string=[NSString stringWithFormat:format_
|
||||
arguments:arguments_];
|
||||
cString=[string cString];
|
||||
fputs(cString,stdout);
|
||||
fputs("\n",stdout);
|
||||
fflush(stdout);
|
||||
[self logErrorWithFormat:@"%@",string];
|
||||
};
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@implementation GSWApplication (GSWStatisticsSupport)
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -3263,6 +3339,21 @@ int GSWApplicationMain(NSString* _applicationClassName,
|
|||
forKey:GSWOPT_DebuggingEnabled];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
//NDFN
|
||||
+(BOOL)isStatusDebuggingEnabled
|
||||
{
|
||||
return [[[NSUserDefaults standardUserDefaults] objectForKey:GSWOPT_StatusDebuggingEnabled] boolValue];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
//NDFN
|
||||
+(void)setStatusDebuggingEnabled:(BOOL)flag_
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:flag_]
|
||||
forKey:GSWOPT_StatusDebuggingEnabled];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
+(BOOL)autoOpenInBrowser
|
||||
{
|
||||
|
@ -3603,6 +3694,20 @@ int GSWApplicationMain(NSString* _applicationClassName,
|
|||
return _sessionTimeOut;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
//NDFN
|
||||
+(NSString*)debugSetConfigFilePath
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] objectForKey:GSWOPT_DebugSetConfigFilePath];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
+(void)setDebugSetConfigFilePath:(NSString*)debugSetConfigFilePath_
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults] setObject:debugSetConfigFilePath_
|
||||
forKey:GSWOPT_DebugSetConfigFilePath];
|
||||
};
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
@ -3891,7 +3996,7 @@ int GSWApplicationMain(NSString* _applicationClassName,
|
|||
{
|
||||
NSString* _moduleName=[NSString stringUniqueIdWithLength:4];//TODO
|
||||
NGObjCModule* module=[NGObjCModule moduleWithName:_moduleName];
|
||||
_ok=[module executeWithClasses:_newClasses];
|
||||
_ok=[module executeWithClassArray:_newClasses];
|
||||
NSDebugMLLog(@"low",@"_ok:%d",(int)_ok);
|
||||
if (!_ok)
|
||||
{
|
||||
|
@ -4204,4 +4309,3 @@ int GSWApplicationMain(NSString* _applicationClassName,
|
|||
|
||||
@end
|
||||
*/
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
//--------------------------------------------------------------------
|
||||
-(NSString*)description
|
||||
{
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
LOGObjectFnNotImplemented(); //TODOFN
|
||||
return [super description];
|
||||
};
|
||||
|
@ -707,7 +707,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
LOGAssertGood(_object);
|
||||
GSWLogAssertGood(_object);
|
||||
[_object setIVarNamed:_part
|
||||
withValue:value_];
|
||||
_object=nil;
|
||||
|
|
|
@ -206,7 +206,7 @@ static char rcsId[] = "$Id$";
|
|||
NSDebugMLLog(@"gswdync",@"_component=%@",_component);
|
||||
NSDebugMLLog(@"gswdync",@"_selections=%d",_selections);
|
||||
NSDebugMLLog(@"gswdync",@"selections=%@",selections);
|
||||
LOGAssertGood(_component);
|
||||
GSWLogAssertGood(_component);
|
||||
#if !GSWEB_STRICT
|
||||
NS_DURING
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
{
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
GSWLogC("Dealloc GSWComponent");
|
||||
GSWLogC("Dealloc GSWComponent: name");
|
||||
DESTROY(name);
|
||||
|
@ -259,7 +259,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
//TODO
|
||||
NSString* _dscr=nil;
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
// GSWLogC("GSWComponent description A");
|
||||
NSDebugMLLog(@"gswcomponents",@"GSWComponent description Self=%p",self);
|
||||
_dscr=[NSString stringWithFormat:@"<%s %p - ",
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
//or @"http://host.com/cgi/GSWeb"
|
||||
#define GSWOPTVALUE_CachingEnabled @"YES"
|
||||
#define GSWOPTVALUE_DebuggingEnabled @"YES"
|
||||
#define GSWOPTVALUE_StatusDebuggingEnabled @"YES"
|
||||
#define GSWOPTVALUE_DirectConnectEnabled @"YES"
|
||||
#define GSWOPTVALUE_FrameworksBaseURL @"/GSW/Frameworks"
|
||||
#define GSWOPTVALUE_IncludeCommentsInResponse @"YES"
|
||||
|
|
|
@ -94,10 +94,10 @@ static char rcsId[] = "$Id$";
|
|||
-(NSString*)description
|
||||
{
|
||||
NSString* _dscr=nil;
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
if (value)
|
||||
{
|
||||
LOGAssertGood(value);
|
||||
GSWLogAssertGood(value);
|
||||
};
|
||||
_dscr=[NSString stringWithFormat:@"<%s %p - value=%@",
|
||||
object_get_class_name(self),
|
||||
|
|
|
@ -156,6 +156,7 @@ extern NSString* GSWOPT_CGIAdaptorURL;
|
|||
extern NSString* GSWOPT_CachingEnabled;
|
||||
extern NSString* GSWOPT_ComponentRequestHandlerKey;
|
||||
extern NSString* GSWOPT_DebuggingEnabled;
|
||||
extern NSString* GSWOPT_StatusDebuggingEnabled;
|
||||
extern NSString* GSWOPT_DirectActionRequestHandlerKey;
|
||||
extern NSString* GSWOPT_DirectConnectEnabled;
|
||||
extern NSString* GSWOPT_FrameworksBaseURL;
|
||||
|
@ -172,6 +173,7 @@ extern NSString* GSWOPT_SessionTimeOut;
|
|||
extern NSString* GSWOPT_WorkerThreadCount;
|
||||
extern NSString* GSWOPT_ProjectSearchPath;
|
||||
extern NSString* GSWOPT_MultiThreadEnabled;
|
||||
extern NSString* GSWOPT_DebugSetConfigFilePath;
|
||||
|
||||
|
||||
//====================================================================
|
||||
|
|
|
@ -225,6 +225,7 @@ NSString* GSWOPT_CGIAdaptorURL=@"WOCGIAdaptorURL";
|
|||
NSString* GSWOPT_CachingEnabled=@"WOCachingEnabled";
|
||||
NSString* GSWOPT_ComponentRequestHandlerKey=@"WOComponentRequestHandlerKey";
|
||||
NSString* GSWOPT_DebuggingEnabled=@"WODebuggingEnabled";
|
||||
NSString* GSWOPT_StatusDebuggingEnabled=@"WOStatusDebuggingEnabled";//NDFN
|
||||
NSString* GSWOPT_DirectActionRequestHandlerKey=@"WODirectActionRequestHandlerKey";
|
||||
NSString* GSWOPT_DirectConnectEnabled=@"WODirectConnectEnabled";
|
||||
NSString* GSWOPT_FrameworksBaseURL=@"WOFrameworksBaseURL";
|
||||
|
@ -249,6 +250,7 @@ NSString* GSWOPT_CGIAdaptorURL=@"GSWCGIAdaptorURL";
|
|||
NSString* GSWOPT_CachingEnabled=@"GSWCachingEnabled";
|
||||
NSString* GSWOPT_ComponentRequestHandlerKey=@"GSWComponentRequestHandlerKey";
|
||||
NSString* GSWOPT_DebuggingEnabled=@"GSWDebuggingEnabled";
|
||||
NSString* GSWOPT_StatusDebuggingEnabled=@"GSWStatusDebuggingEnabled";//NDFN
|
||||
NSString* GSWOPT_DirectActionRequestHandlerKey=@"GSWDirectActionRequestHandlerKey";
|
||||
NSString* GSWOPT_DirectConnectEnabled=@"GSWDirectConnectEnabled";
|
||||
NSString* GSWOPT_FrameworksBaseURL=@"GSWFrameworksBaseURL";
|
||||
|
@ -266,6 +268,8 @@ NSString* GSWOPT_WorkerThreadCount=@"GSWWorkerThreadCount";
|
|||
NSString* GSWOPT_ProjectSearchPath=@"NSProjectSearchPath";
|
||||
#endif
|
||||
NSString* GSWOPT_MultiThreadEnabled=@"GSWMTEnabled";
|
||||
NSString* GSWOPT_DebugSetConfigFilePath=@"GSWDebugSetConfigFilePath";
|
||||
|
||||
//====================================================================
|
||||
// Cache Marker
|
||||
NSString* GSNotFoundMarker=@"NotFoundMarker";
|
||||
|
|
|
@ -47,7 +47,7 @@ static int dontTraceComponentActionURL=0;
|
|||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
{
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
NSDebugFLog(@"Dealloc GSWContext %p",(void*)self);
|
||||
NSDebugFLog0(@"Release GSWContext senderID");
|
||||
DESTROY(senderID);
|
||||
|
|
|
@ -26,31 +26,21 @@
|
|||
#ifndef _GSWebDebug_h__
|
||||
#define _GSWebDebug_h__
|
||||
|
||||
//extern void logObjectFnNotImplemented(CONST char* file,int line,id obj,SEL cmd);
|
||||
//extern void logClassFnNotImplemented(CONST char* file,int line,Class class,SEL cmd);
|
||||
//extern void logObjectFnStart(CONST char* file,int line,id obj,SEL cmd,CONST char* comment,BOOL dumpClass);
|
||||
//extern void logObjectFnStop(CONST char* file,int line,id obj,SEL cmd,CONST char* comment);
|
||||
//extern void logClassFnStart(CONST char* file,int line,Class class,SEL cmd,CONST char* comment);
|
||||
//extern void logClassFnStop(CONST char* file,int line,Class class,SEL cmd,CONST char* comment);
|
||||
extern void DumpObject(CONST char* file,int line,id object,int level);
|
||||
extern void GSWLog(NSString* string);
|
||||
extern void GSWLogStdOut(NSString* string);
|
||||
extern void GSWLogCStdOut(CONST char* string);
|
||||
extern void GSWLog(NSString* string);
|
||||
extern void GSWLogC(CONST char* string);
|
||||
extern void GSWLogF(NSString* format,...);
|
||||
//extern void GSWLogFStdOut(NSString* format,...);
|
||||
//extern void GSWLogFCond(BOOL cond,NSString* format,...);
|
||||
//extern void GSWLogError(CONST char* file,int line);
|
||||
//extern void GSWLogException(CONST char* comment,CONST char* file,int line);
|
||||
//extern void GSWLogExceptionF(CONST char* file,int line,NSString* format,...);
|
||||
//extern void GSWLogErrorF(CONST char* file,int line,NSString* format,...);
|
||||
extern void GSWAssertGood(NSObject* object,CONST char* file,int line);
|
||||
|
||||
#define LOGDumpObject(object,level) DumpObject(__FILE__,__LINE__,object,level)
|
||||
//#define LOGError(); GSWLogError(__FILE__,__LINE__);
|
||||
//#define LOGException(comment); GSWLogException(comment,__FILE__,__LINE__);
|
||||
#define LOGAssertGood(object); GSWAssertGood(object,__FILE__,__LINE__);
|
||||
#ifdef DEBUG
|
||||
extern void GSWLogC_(CONST char* file,int line,CONST char* string);
|
||||
extern void GSWLogDumpObject_(CONST char* file,int line,id object,int deep);
|
||||
extern void GSWLogAssertGood_(CONST char* file,int line,NSObject* object);
|
||||
|
||||
#define GSWLogC(cString); GSWLogC_(__FILE__,__LINE__,cString);
|
||||
#define GSWLogDumpObject(object,deep); GSWLogDumpObject_(__FILE__,__LINE__,object,deep);
|
||||
#define GSWLogAssertGood(object); GSWLogAssertGood_(__FILE__,__LINE__,object);
|
||||
#else
|
||||
#define GSWLogC(cString);
|
||||
#define GSWLogDumpObject(object,deep);
|
||||
#define GSWLogAssertGood(object);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#define LOGClassFnStart() \
|
||||
|
@ -153,43 +143,37 @@ extern void GSWAssertGood(NSObject* object,CONST char* file,int line);
|
|||
do { if (GSDebugSet(@"seriousError") == YES) { \
|
||||
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
|
||||
NSString *fmt2 = [NSString stringWithFormat:@"*SERIOUS ERROR*: %@",fmt]; \
|
||||
/*NSLog(fmt2,## args);*/ \
|
||||
[GSWApp logErrorWithFormat:fmt2, ## args];}} while (0)
|
||||
NSLog(fmt2, ## args); }} while (0)
|
||||
|
||||
#define LOGSeriousError0(format) \
|
||||
do { if (GSDebugSet(@"seriousError") == YES) { \
|
||||
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
|
||||
NSString *fmt2 = [NSString stringWithFormat:@"*SERIOUS ERROR*: %@",fmt]; \
|
||||
/*NSLog(fmt2);*/ \
|
||||
[GSWApp logErrorWithFormat:@"%@",fmt2]; }} while (0)
|
||||
NSLog(@"%@",fmt2); }} while (0)
|
||||
|
||||
#define LOGException(format, args...) \
|
||||
do { if (GSDebugSet(@"exception") == YES) { \
|
||||
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
|
||||
NSString *fmt2 = [NSString stringWithFormat:@"*EXCEPTION*: %@",fmt]; \
|
||||
/*NSLog(fmt2,## args);*/ \
|
||||
[GSWApp logErrorWithFormat:fmt2, ## args]; }} while (0)
|
||||
NSLog(fmt2, ## args); }} while (0)
|
||||
|
||||
#define LOGException0(format) \
|
||||
do { if (GSDebugSet(@"exception") == YES) { \
|
||||
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
|
||||
NSString *fmt2 = [NSString stringWithFormat:@"*EXCEPTION*: %@",fmt]; \
|
||||
/*NSLog(fmt2);*/ \
|
||||
[GSWApp logErrorWithFormat:@"%@",fmt2]; }} while (0)
|
||||
NSLog(@"%@",fmt2); }} while (0)
|
||||
|
||||
#define LOGError(format, args...) \
|
||||
do { if (GSDebugSet(@"error") == YES) { \
|
||||
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
|
||||
NSString *fmt2 = [NSString stringWithFormat:@"*ERROR*: %@",fmt]; \
|
||||
/*NSLog(fmt2,## args);*/ \
|
||||
[GSWApp logErrorWithFormat:fmt2, ## args];}} while (0)
|
||||
NSLog(fmt2, ## args);}} while (0)
|
||||
|
||||
#define LOGError0(format) \
|
||||
do { if (GSDebugSet(@"error") == YES) { \
|
||||
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,format); \
|
||||
NSString *fmt2 = [NSString stringWithFormat:@"*ERROR*: %@",fmt]; \
|
||||
/*NSLog(fmt2);*/ \
|
||||
[GSWApp logErrorWithFormat:@"%@",fmt2]; }} while (0)
|
||||
NSLog(@"%@",fmt2); }} while (0)
|
||||
|
||||
#define NSDebugMLLogCond(cond, level, format, args...) \
|
||||
do { if (cond && GSDebugSet(level) == YES) { \
|
||||
|
|
|
@ -30,7 +30,6 @@ static char rcsId[] = "$Id$";
|
|||
|
||||
#define USTART NSAutoreleasePool* arp=[NSAutoreleasePool new];
|
||||
#define USTOP DESTROY(arp);
|
||||
#define DOTRACE 1
|
||||
|
||||
@interface NSObject (GSISA)
|
||||
-(Class)isa;
|
||||
|
@ -43,91 +42,10 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
@end
|
||||
|
||||
void GSWAssertGood(NSObject* object,CONST char* file,int line)
|
||||
{
|
||||
if (object)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if ([object isa]==((Class)0xdeadface))
|
||||
{
|
||||
char buffer[1024]="";
|
||||
sprintf(buffer,"DEAD FACE: object %p isa=%p in %s at %d\n",
|
||||
(void*)object,
|
||||
(void*)[object isa],
|
||||
file,
|
||||
line);
|
||||
GSWLogCStdOut(buffer);
|
||||
GSWLogC(buffer);
|
||||
NSCParameterAssert([object isa]==(Class)0xdeadface);
|
||||
};
|
||||
#else
|
||||
NSCAssert2([object isa]!=((Class)0xdeadface),@"Dead face object %s %d",file, line);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef DEBUG
|
||||
char buffer[1024]="";
|
||||
sprintf(buffer,"NULL: object %p in %s at %d\n",
|
||||
(void*)object,
|
||||
file,
|
||||
line);
|
||||
GSWLogCStdOut(buffer);
|
||||
GSWLogC(buffer);
|
||||
NSCParameterAssert(object);
|
||||
#else
|
||||
NSCAssert2(object,@"Nil object %s %d",file, line);
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
void GSWLogExceptionF(CONST char* file,int line,NSString* format,...)
|
||||
{
|
||||
NSString* string=nil;
|
||||
va_list ap;
|
||||
USTART
|
||||
va_start (ap, format);
|
||||
string=[NSString stringWithFormat:format
|
||||
arguments: ap];
|
||||
va_end (ap);
|
||||
#if DOTRACE
|
||||
GSWLogCStdOut("EXCEPTION:");
|
||||
GSWLogC("EXCEPTION:");
|
||||
GSWLogStdOut(string);
|
||||
GSWLog(string);
|
||||
#endif
|
||||
USTOP
|
||||
};
|
||||
void GSWLogException(CONST char* comment,CONST char* file,int line)
|
||||
{
|
||||
char buff[25];
|
||||
fputs ("EXCEPTION (", stderr);
|
||||
fputs ("EXCEPTION (", stdout);
|
||||
fputs (file, stderr);
|
||||
fputs (file, stdout);
|
||||
fputs (" ", stderr);
|
||||
fputs (" ", stdout);
|
||||
sprintf(buff,"%d",line);
|
||||
fputs (buff, stderr);
|
||||
fputs (buff, stdout);
|
||||
fputs ("):", stderr);
|
||||
fputs ("):", stdout);
|
||||
if (comment)
|
||||
{
|
||||
fputs (comment, stderr);
|
||||
fputs (comment, stdout);
|
||||
};
|
||||
fputs ("\n", stderr);
|
||||
fputs ("\n", stdout);
|
||||
fflush(stderr);
|
||||
fflush(stdout);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void GSWLogC(CONST char* string)
|
||||
void GSWLogC_(CONST char* file,int line,CONST char* string)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if DOTRACE
|
||||
int len=0;
|
||||
if ([NSThread isMultiThreaded])
|
||||
{
|
||||
|
@ -141,214 +59,16 @@ void GSWLogC(CONST char* string)
|
|||
fprintf(stderr,"%p [%ld] (%d) ",tid,(long)tid,(int)getpid());
|
||||
};
|
||||
};
|
||||
fprintf(stderr,"File %s: %d. ",file,line);
|
||||
fprintf(stderr,string);
|
||||
len=strlen(string);
|
||||
if (len<=0 || string[len-1]!='\n')
|
||||
fprintf(stderr,"\n");
|
||||
fflush(stderr);
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void GSWLogCStdOut(CONST char* string)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if DOTRACE
|
||||
int len=0;
|
||||
if ([NSThread isMultiThreaded])
|
||||
{
|
||||
NSThread* t = [NSThread currentThread];
|
||||
fprintf(stdout,"TID=");
|
||||
if (t && t->_thread_id)
|
||||
fprintf(stdout,"%p [%ld] (%d) ",(void*)t->_thread_id,(long)t->_thread_id,(int)getpid());
|
||||
else
|
||||
{
|
||||
void* tid=(void*)objc_thread_id();
|
||||
fprintf(stdout,"%p [%ld] (%d) ",tid,(long)tid,(int)getpid());
|
||||
};
|
||||
};
|
||||
fprintf(stdout,string);
|
||||
len=strlen(string);
|
||||
if (len<=0 || string[len-1]!='\n')
|
||||
fprintf(stdout,"\n");
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void _GSWLog(NSString* string)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if DOTRACE
|
||||
USTART
|
||||
GSWLogC([string cString]);
|
||||
USTOP
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void _GSWLogStdOut(NSString* string)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if DOTRACE
|
||||
USTART
|
||||
GSWLogCStdOut([string cString]);
|
||||
USTOP
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
/*
|
||||
//--------------------------------------------------------------------
|
||||
void _NSDebugMLog(NSString* format,...)
|
||||
{
|
||||
NSString* string=nil;
|
||||
va_list ap;
|
||||
USTART
|
||||
va_start (ap, format);
|
||||
string=[NSString stringWithFormat:format
|
||||
arguments: ap];
|
||||
va_end (ap);
|
||||
#if DOTRACE
|
||||
_GSWLog(string);
|
||||
#endif
|
||||
USTOP
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void _NSDebugMLog(NSString* format,...)
|
||||
{
|
||||
NSString* string=nil;
|
||||
va_list ap;
|
||||
USTART
|
||||
va_start (ap, format);
|
||||
string=[NSString stringWithFormat:format
|
||||
arguments: ap];
|
||||
va_end (ap);
|
||||
#if DOTRACE
|
||||
_GSWLogStdOut(string);
|
||||
_GSWLog(string);
|
||||
#endif
|
||||
USTOP
|
||||
};
|
||||
*/
|
||||
//--------------------------------------------------------------------
|
||||
void GSWLogError(CONST char* file,int line)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
USTART
|
||||
{
|
||||
NSString* string=[NSString stringWithFormat:@"ERROR ! file %s line %d\n",
|
||||
(file && isalpha(*file) && line>=0 && line<=50000) ? file :"",
|
||||
line];
|
||||
_GSWLog(string);
|
||||
#if DOTRACE
|
||||
_GSWLogStdOut(string);
|
||||
#endif
|
||||
};
|
||||
USTOP
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void GSWLogErrorF(CONST char* file,int line,NSString* format,...)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
NSString* string=nil;
|
||||
NSString* stringError=nil;
|
||||
va_list ap;
|
||||
USTART
|
||||
va_start (ap, format);
|
||||
string=[NSString stringWithFormat:format
|
||||
arguments: ap];
|
||||
stringError=[NSString stringWithFormat:@"ERROR ! file %s line %d: %@\n",
|
||||
(file && isalpha(*file) && line>=0 && line<=50000) ? file :"",
|
||||
line,
|
||||
string];
|
||||
_GSWLog(stringError);
|
||||
#if DOTRACE
|
||||
_GSWLogStdOut(stringError);
|
||||
#endif
|
||||
va_end (ap);
|
||||
USTOP
|
||||
#endif
|
||||
};
|
||||
/*
|
||||
//--------------------------------------------------------------------
|
||||
void NSDebugMLogCond(BOOL cond,NSString* format,...)
|
||||
{
|
||||
if (cond)
|
||||
{
|
||||
NSString* string=nil;
|
||||
va_list ap;
|
||||
USTART
|
||||
va_start (ap, format);
|
||||
string=[NSString stringWithFormat:format
|
||||
arguments: ap];
|
||||
va_end (ap);
|
||||
#if DOTRACE
|
||||
_GSWLog(string);
|
||||
#endif
|
||||
USTOP
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void GSWLog(NSString* string)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if DOTRACE
|
||||
NSDebugFLog(@"%@",string);
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void GSWLogStdOut(NSString* string)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#if DOTRACE
|
||||
GSWLogCStdOut([string cString]);
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
//--------------------------------------------------------------------
|
||||
void NSDebugMLog(NSString* format,...)
|
||||
{
|
||||
NSString* string=nil;
|
||||
va_list ap;
|
||||
USTART
|
||||
va_start (ap, format);
|
||||
string=[NSString stringWithFormat:format
|
||||
arguments: ap];
|
||||
va_end(ap);
|
||||
#if DOTRACE
|
||||
GSWLog(string);
|
||||
#endif
|
||||
USTOP
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void NSDebugMLog(NSString* format,...)
|
||||
{
|
||||
NSString* string=nil;
|
||||
va_list ap;
|
||||
USTART
|
||||
va_start (ap, format);
|
||||
string=[NSString stringWithFormat:format
|
||||
arguments: ap];
|
||||
va_end(ap);
|
||||
#if DOTRACE
|
||||
GSWLogStdOut(string);
|
||||
#endif
|
||||
USTOP
|
||||
};
|
||||
*/
|
||||
//--------------------------------------------------------------------
|
||||
NSString* objectDescription(id object)
|
||||
{
|
||||
|
@ -362,137 +82,9 @@ NSString* objectDescription(id object)
|
|||
};
|
||||
return description;
|
||||
};
|
||||
/*
|
||||
//--------------------------------------------------------------------
|
||||
void logObjectFnNotImplemented(CONST char* file,int line,id obj,SEL cmd)
|
||||
{
|
||||
#if DOTRACE
|
||||
USTART
|
||||
if (!(file && isalpha(*file) && line>=0 && line<=20000))
|
||||
NSDebugMLog(@"Not Implemented Object Function %s",
|
||||
sel_get_name(cmd));
|
||||
else
|
||||
{
|
||||
BOOL dumpClass=YES;
|
||||
if (!CLS_ISINITIALIZED(object_get_class(obj)))
|
||||
dumpClass=NO;
|
||||
|
||||
NSDebugMLog(@"%s %d - Not Implemented Object Function %s (Class %s)\n",
|
||||
(file && isalpha(*file) && line>=0 && line<=20000) ? file :"",
|
||||
line,
|
||||
sel_get_name(cmd),
|
||||
((dumpClass) ? object_get_class_name(obj) : "***"));
|
||||
};
|
||||
USTOP
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void logClassFnNotImplemented(CONST char* file,int line,Class class,SEL cmd)
|
||||
{
|
||||
#if DOTRACE
|
||||
USTART
|
||||
if (!(file && isalpha(*file) && line>=0 && line<=20000))
|
||||
NSDebugMLog(@"Not Implemented Class Function %s",
|
||||
sel_get_name(cmd));
|
||||
else
|
||||
{
|
||||
BOOL dumpClass=YES;
|
||||
if (!CLS_ISINITIALIZED(class))
|
||||
dumpClass=NO;
|
||||
NSDebugMLog(@"%s %d - Not Implemented Class Function %s (Class %s)\n",
|
||||
(file && isalpha(*file) && line>=0 && line<=20000) ? file :"",
|
||||
line,
|
||||
sel_get_name(cmd),
|
||||
((dumpClass && class) ? class->name : "***"));
|
||||
};
|
||||
USTOP
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void logObjectFnStart(CONST char* file,int line,id obj,SEL cmd,CONST char* comment,BOOL dumpClass)
|
||||
{
|
||||
#if DOTRACE
|
||||
USTART
|
||||
iFnLevel++;
|
||||
if (!CLS_ISINITIALIZED(object_get_class(obj)))
|
||||
dumpClass=NO;
|
||||
_NSDebugMLog(@"%s %s %d - Obj:%p Start:%s (Class %s [%s])\n",
|
||||
getOpenSign(),
|
||||
((file && isalpha(*file) && line>=0 && line<=20000) ? file :""),
|
||||
line,
|
||||
(void*)obj,
|
||||
sel_get_name(cmd),
|
||||
((dumpClass) ? object_get_class_name(obj) : "***"),
|
||||
comment ? comment : "");
|
||||
USTOP
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void logObjectFnStop(CONST char* file,int line,id obj,SEL cmd,CONST char* comment)
|
||||
{
|
||||
#if DOTRACE
|
||||
BOOL dumpClass=YES;
|
||||
USTART
|
||||
if (!obj || !CLS_ISINITIALIZED(object_get_class(obj)))
|
||||
dumpClass=NO;
|
||||
_NSDebugMLog(@"%s %s %d - Obj:%p Stop:%s (Class %s [%s])\n",
|
||||
getCloseSign(),
|
||||
(file && isalpha(*file) && line>=0 && line<=20000) ? file :"",
|
||||
line,
|
||||
(void*)obj,
|
||||
sel_get_name(cmd),
|
||||
((dumpClass) ? object_get_class_name(obj) : "***"),
|
||||
comment ? comment : "");
|
||||
iFnLevel--;
|
||||
USTOP
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void logClassFnStart(CONST char* file,int line,Class class,SEL cmd,CONST char* comment)
|
||||
{
|
||||
#if DOTRACE
|
||||
BOOL dumpClass=YES;
|
||||
USTART
|
||||
iFnLevel++;
|
||||
if (!CLS_ISINITIALIZED(class))
|
||||
dumpClass=NO;
|
||||
_NSDebugMLog(@"%s %s %d - Class Start:%s (Class %s [%s])\n",
|
||||
getOpenSign(),
|
||||
(file && isalpha(*file) && line>=0 && line<=20000) ? file :"",
|
||||
line,
|
||||
sel_get_name(cmd),
|
||||
((dumpClass && class) ? class->name : "***"),
|
||||
comment ? comment : "");
|
||||
USTOP
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void logClassFnStop(CONST char* file,int line,Class class,SEL cmd,CONST char* comment)
|
||||
{
|
||||
#if DOTRACE
|
||||
BOOL dumpClass=YES;
|
||||
USTART
|
||||
if (!CLS_ISINITIALIZED(class))
|
||||
dumpClass=NO;
|
||||
_NSDebugMLog(@"%s %s %d - Class Stop:%s (Class %s [%s])\n",
|
||||
getCloseSign(),
|
||||
(file && isalpha(*file) && line>=0 && line<=20000) ? file :"",
|
||||
line,
|
||||
sel_get_name(cmd),
|
||||
((dumpClass && class) ? class->name : "***"),
|
||||
comment ? comment : "");
|
||||
iFnLevel--;
|
||||
USTOP
|
||||
#endif
|
||||
};
|
||||
*/
|
||||
//--------------------------------------------------------------------
|
||||
NSString* IVarInString(CONST char*_type,void* _value)
|
||||
NSString* IVarInString(const char* _type,void* _value)
|
||||
{
|
||||
if (_type && _value)
|
||||
{
|
||||
|
@ -624,7 +216,7 @@ NSString* IVarInString(CONST char*_type,void* _value)
|
|||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
NSString* TypeToNSString(CONST char*_type)
|
||||
NSString* TypeToNSString(const char* _type)
|
||||
{
|
||||
if (_type)
|
||||
{
|
||||
|
@ -632,10 +224,10 @@ NSString* TypeToNSString(CONST char*_type)
|
|||
{
|
||||
case _C_ID:
|
||||
{ // '@'
|
||||
CONST char *t = _type + 1;
|
||||
const char *t = _type + 1;
|
||||
if (*t == '"')
|
||||
{
|
||||
CONST char *start = t + 1;
|
||||
const char *start = t + 1;
|
||||
do
|
||||
{
|
||||
t++;
|
||||
|
@ -673,13 +265,13 @@ NSString* TypeToNSString(CONST char*_type)
|
|||
case _C_STRUCT_B:
|
||||
{
|
||||
NSString *structName = nil;
|
||||
CONST char *t = _type + 1;
|
||||
const char *t = _type + 1;
|
||||
|
||||
if (*t == '?')
|
||||
structName = @"?";
|
||||
else
|
||||
{
|
||||
CONST char *beg = t;
|
||||
const char *beg = t;
|
||||
while ((*t != '=') && (*t != '\0') && (*t != _C_STRUCT_E))
|
||||
t++;
|
||||
structName = [NSString stringWithCString:beg length:(t - beg)];
|
||||
|
@ -697,10 +289,9 @@ NSString* TypeToNSString(CONST char*_type)
|
|||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void DumpIVar(id object,struct objc_ivar* ivar,int level)
|
||||
void DumpIVar(id object,struct objc_ivar* ivar,int deep)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if (ivar && object && level>=0)
|
||||
if (ivar && object && deep>=0)
|
||||
{
|
||||
void* pValue=((void*)object) + ivar->ivar_offset;
|
||||
NSString* pType=TypeToNSString(ivar->ivar_type);
|
||||
|
@ -709,20 +300,19 @@ void DumpIVar(id object,struct objc_ivar* ivar,int level)
|
|||
ivar->ivar_name,
|
||||
pType,
|
||||
pIVar);
|
||||
if (level>0 && ivar->ivar_type && *ivar->ivar_type==_C_ID && pValue)
|
||||
if (deep>0 && ivar->ivar_type && *ivar->ivar_type==_C_ID && pValue)
|
||||
{
|
||||
DumpObject(NULL,0,*((id*)pValue),level);
|
||||
GSWLogDumpObject_(NULL,0,*((id*)pValue),deep);
|
||||
};
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void DumpObject(CONST char* file,int line,id object,int level)
|
||||
//Dump object
|
||||
void GSWLogDumpObject_(CONST char* file,int line,id object,int deep)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
USTART
|
||||
if (object && level>0)
|
||||
if (object && deep>0)
|
||||
{
|
||||
struct objc_ivar_list *ivars=NULL;
|
||||
Class class = [object class];
|
||||
|
@ -731,7 +321,7 @@ void DumpObject(CONST char* file,int line,id object,int level)
|
|||
NSDebugFLog(@"--%s %d [%d] Dumping object %p of Class %s Description:%@\n",
|
||||
(file && isalpha(*file) && line>=0 && line<=20000) ? file :"",
|
||||
line,
|
||||
level,
|
||||
deep,
|
||||
(void*)object,
|
||||
class->name,
|
||||
objectDescription(object));
|
||||
|
@ -744,13 +334,37 @@ void DumpObject(CONST char* file,int line,id object,int level)
|
|||
int i;
|
||||
for (i = 0; i < ivars->ivar_count; i++)
|
||||
{
|
||||
DumpIVar(object,&ivars->ivar_list[i],level-1);
|
||||
DumpIVar(object,&ivars->ivar_list[i],deep-1);
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
USTOP
|
||||
#endif
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void GSWLogAssertGood_(CONST char* file,int line,NSObject* object)
|
||||
{
|
||||
if (object)
|
||||
{
|
||||
if ([object isa]==((Class)0xdeadface))
|
||||
{
|
||||
[GSWApp statusDebugWithFormat:@"DEAD FACE: object %p isa=%p in %s at %d\n",
|
||||
(void*)object,
|
||||
(void*)[object isa],
|
||||
file,
|
||||
line];
|
||||
NSCParameterAssert([object isa]==(Class)0xdeadface);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
[GSWApp statusDebugWithFormat:@"NULL: object %p in %s at %d\n",
|
||||
(void*)object,
|
||||
file,
|
||||
line];
|
||||
NSCParameterAssert(object);
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -93,8 +93,7 @@ static char rcsId[] = "$Id$";
|
|||
object:fileHandle];
|
||||
*/
|
||||
[fileHandle acceptConnectionInBackgroundAndNotify];
|
||||
GSWLogCStdOut("Waiting for connections.\n");
|
||||
GSWLogC("Waiting for connections.\n");
|
||||
[GSWApplication statusLogWithFormat:@"Waiting for connections."];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -232,8 +231,7 @@ static char rcsId[] = "$Id$";
|
|||
_listenHandle=[notification object];
|
||||
requestDate=[NSCalendarDate calendarDate];
|
||||
requestDateString=[NSString stringWithFormat:@"New Request %@",requestDate];
|
||||
GSWLogCStdOut([requestDateString cString]);
|
||||
GSWLogC([requestDateString cString]);
|
||||
[GSWApplication statusLogWithFormat:@"%@",requestDateString];
|
||||
NSDebugMLLog(@"info",@"_listenHandle=%p",(void*)_listenHandle);
|
||||
inStream = [[notification userInfo]objectForKey:@"NSFileHandleNotificationFileHandleItem"];
|
||||
NSDebugMLLog(@"info",@"announceNewConnection notification=%@\n",notification);
|
||||
|
@ -268,8 +266,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
requestDate=[NSCalendarDate calendarDate];
|
||||
requestDateString=[NSString stringWithFormat:@"Lauch Thread (Multi) %@",requestDate];
|
||||
GSWLogCStdOut([requestDateString cString]);
|
||||
GSWLogC([requestDateString cString]);
|
||||
[GSWApplication statusLogWithFormat:@"%@",requestDateString];
|
||||
NSDebugMLLog(@"info",
|
||||
@"Lauch Thread (Multi) %p",
|
||||
(void*)_newThread);
|
||||
|
@ -282,7 +279,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
//Runit after
|
||||
/*
|
||||
GSWLogCStdOut("Lauch Thread (Mono)");
|
||||
[GSWApplication statusLogWithFormat:@"Lauch Thread (Mono)"];
|
||||
NSDebugMLLog(@"info",
|
||||
@"Lauch Thread (Mono) %p",
|
||||
(void*)_newThread);
|
||||
|
@ -292,7 +289,7 @@ static char rcsId[] = "$Id$";
|
|||
}
|
||||
else
|
||||
{
|
||||
GSWLogCStdOut("Set Thread to wait");
|
||||
[GSWApplication statusLogWithFormat:@"Set Thread to wait"];
|
||||
NSDebugMLLog(@"info",
|
||||
@"Set Thread to wait %p",
|
||||
(void*)_newThread);
|
||||
|
@ -320,7 +317,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
requestDate=[NSCalendarDate calendarDate];
|
||||
requestDateString=[NSString stringWithFormat:@"Lauch Thread (Mono) %@",requestDate];
|
||||
GSWLogCStdOut([requestDateString cString]);
|
||||
[GSWApplication statusLogWithFormat:@"%@",requestDateString];
|
||||
NSDebugMLLog(@"info",
|
||||
@"%@ %p",
|
||||
requestDateString,
|
||||
|
@ -329,7 +326,7 @@ static char rcsId[] = "$Id$";
|
|||
DESTROY(_newThread);
|
||||
requestDate=[NSCalendarDate calendarDate];
|
||||
requestDateString=[NSString stringWithFormat:@"Stop Thread (Mono) %@",requestDate];
|
||||
GSWLogCStdOut([requestDateString cString]);
|
||||
[GSWApplication statusLogWithFormat:@"%@",requestDateString];
|
||||
NSDebugMLLog0(@"info",
|
||||
requestDateString);
|
||||
};
|
||||
|
@ -416,7 +413,7 @@ static char rcsId[] = "$Id$";
|
|||
[waitingThreads removeObjectAtIndex:0];
|
||||
#ifndef NDEBUG
|
||||
pool=[NSAutoreleasePool new];
|
||||
GSWLogCStdOut("Lauch waiting Thread");
|
||||
[GSWApplication statusLogWithFormat:@"Lauch waiting Thread"];
|
||||
NSDebugMLLog(@"info",
|
||||
@"Lauch waiting Thread %p",
|
||||
(void*)_thread);
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
static char rcsId[] = "$Id$";
|
||||
|
||||
#include <gsweb/GSWeb.framework/GSWeb.h>
|
||||
#include <unistd.h>
|
||||
#include "NSNonBlockingFileHandle.h"
|
||||
//====================================================================
|
||||
@implementation GSWDefaultAdaptorThread
|
||||
|
@ -105,10 +106,9 @@ static char rcsId[] = "$Id$";
|
|||
ASSIGN(runDate,[NSDate date]);
|
||||
DESTROY(dispatchRequestDate);
|
||||
DESTROY(sendResponseDate);
|
||||
GSWLogCStdOut("Thread run START");
|
||||
GSWLogC("Thread run START");
|
||||
[GSWApplication statusLogWithFormat:@"Thread run START"];
|
||||
pool=[NSAutoreleasePool new];
|
||||
GSWLogC("pool allocated!");
|
||||
[GSWApplication logWithFormat:@"pool allocated!"];
|
||||
if (isMultiThread)
|
||||
{
|
||||
_threadDictionary=GSCurrentThreadDictionary();
|
||||
|
@ -205,11 +205,9 @@ static char rcsId[] = "$Id$";
|
|||
NSDebugMLog0(@"GSWDefaultAdaptorThread: run end");
|
||||
NSDebugMLLog(@"low",@"application:%@",application);
|
||||
LOGObjectFnStop();
|
||||
GSWLogCStdOut("threadWillExit START");
|
||||
GSWLogC("threadWillExit START");
|
||||
[GSWApplication statusLogWithFormat:@"threadWillExit START"];
|
||||
[application threadWillExit];
|
||||
GSWLogCStdOut("threadWillExit STOP");
|
||||
GSWLogC("threadWillExit STOP");
|
||||
[GSWApplication statusLogWithFormat:@"threadWillExit STOP"];
|
||||
if (isMultiThread)
|
||||
{
|
||||
NSAssert([NSThread isMultiThreaded],@"No MultiThread !");
|
||||
|
@ -217,8 +215,7 @@ static char rcsId[] = "$Id$";
|
|||
}
|
||||
else
|
||||
[self threadExited];
|
||||
GSWLogCStdOut("run STOP");
|
||||
GSWLogC("run STOP");
|
||||
[GSWApplication statusLogWithFormat:@"run STOP"];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
|
|
@ -371,7 +371,7 @@ static char rcsId[] = "$Id$";
|
|||
BOOL isFromClientComponent=NO;
|
||||
NSArray* _attributeAssociations=nil;
|
||||
int elementN=0;
|
||||
CONST BYTE* elements=[elementsMap bytes];
|
||||
const BYTE* elements=[elementsMap bytes];
|
||||
BYTE element=0;
|
||||
int elementsN[4]={0,0,0,0};
|
||||
BOOL inChildren=NO;
|
||||
|
@ -496,7 +496,7 @@ static char rcsId[] = "$Id$";
|
|||
GSWElement* _element=nil;
|
||||
int elementN=0;
|
||||
NSArray* _dynamicChildren=[self dynamicChildren];
|
||||
CONST BYTE* elements=[elementsMap bytes];
|
||||
const BYTE* elements=[elementsMap bytes];
|
||||
BYTE element=0;
|
||||
int elementsN[4]={0,0,0,0};
|
||||
BOOL inChildren=NO;
|
||||
|
@ -577,7 +577,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
int elementN=0;
|
||||
NSArray* _dynamicChildren=[self dynamicChildren];
|
||||
CONST BYTE* elements=[elementsMap bytes];
|
||||
const BYTE* elements=[elementsMap bytes];
|
||||
BYTE element=0;
|
||||
int elementsN[4]={0,0,0,0};
|
||||
BOOL inChildren=NO;
|
||||
|
|
|
@ -311,7 +311,7 @@ static char rcsId[] = "$Id$";
|
|||
NSStringEncoding _encoding=[response_ contentEncoding];
|
||||
NSArray* _dynamicChildren=[self dynamicChildren];//call dynamicChildren //GSWTextField: nil
|
||||
int elementN=0;
|
||||
CONST BYTE* elements=[elementsMap bytes];
|
||||
const BYTE* elements=[elementsMap bytes];
|
||||
BYTE element=0;
|
||||
int elementsN[3]={0,0,0};
|
||||
NSAssert2(_fromIndex<[elementsMap length],@"_fromIndex out of range:%u (length=%d)",_fromIndex,[elementsMap length]);
|
||||
|
@ -353,7 +353,7 @@ static char rcsId[] = "$Id$";
|
|||
GSWElement* _element=nil;
|
||||
int elementN=0;
|
||||
NSArray* _dynamicChildren=[self dynamicChildren];
|
||||
CONST BYTE* elements=[elementsMap bytes];
|
||||
const BYTE* elements=[elementsMap bytes];
|
||||
BYTE element=0;
|
||||
int elementsN[3]={0,0,0};
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]);
|
||||
|
@ -387,7 +387,7 @@ static char rcsId[] = "$Id$";
|
|||
//OK
|
||||
int elementN=0;
|
||||
NSArray* _dynamicChildren=[self dynamicChildren];
|
||||
CONST BYTE* elements=[elementsMap bytes];
|
||||
const BYTE* elements=[elementsMap bytes];
|
||||
BYTE element=0;
|
||||
int elementsN[3]={0,0,0};
|
||||
LOGObjectFnStart();
|
||||
|
|
|
@ -101,7 +101,7 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(NSString*)description
|
||||
{
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
return [NSString stringWithFormat:@"<%s %p - keyPath=%@>",
|
||||
object_get_class_name(self),
|
||||
(void*)self,
|
||||
|
|
|
@ -189,7 +189,7 @@ static char rcsId[] = "$Id$";
|
|||
NSDebugMLLog(@"gswdync",@"_component=%@",_component);
|
||||
NSDebugMLLog(@"gswdync",@"_foundIndex=%d",_foundIndex);
|
||||
NSDebugMLLog(@"gswdync",@"selection=%@",selection);
|
||||
LOGAssertGood(_component);
|
||||
GSWLogAssertGood(_component);
|
||||
#if !GSWEB_STRICT
|
||||
NS_DURING
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
{
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
NSDebugFLog0(@"dealloc GSWRequest");
|
||||
NSDebugFLog0(@"Release GSWRequest method");
|
||||
DESTROY(method);
|
||||
|
|
|
@ -52,7 +52,7 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding;
|
|||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
{
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
NSDebugFLog(@"dealloc Response %p",self);
|
||||
NSDebugFLog0(@"Release Response httpVersion");
|
||||
DESTROY(httpVersion);
|
||||
|
|
|
@ -93,7 +93,7 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
{
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
NSDebugFLog0(@"Dealloc GSWSession");
|
||||
NSDebugFLog0(@"Dealloc GSWSession: sessionID");
|
||||
DESTROY(sessionID);
|
||||
|
@ -130,7 +130,7 @@ static char rcsId[] = "$Id$";
|
|||
-(NSString*)description
|
||||
{
|
||||
NSString* dscr=nil;
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
/*
|
||||
NSDebugMLLog(@"sessions",@"selfCount=%u",(unsigned int)[self retainCount]);
|
||||
NSDebugMLLog(@"sessions",@"sessionIDCount=%u",(unsigned int)[sessionID retainCount]);
|
||||
|
@ -411,7 +411,7 @@ static char rcsId[] = "$Id$";
|
|||
unsigned int _stackIndex=0;
|
||||
unsigned int _contextArrayIndex=0;
|
||||
LOGObjectFnStart();
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
NSAssert(contextID_,@"No contextID");
|
||||
NSAssert([contextID_ length]>0,@"contextID empty");
|
||||
NSDebugMLLog(@"sessions",@"contextID=%@",contextID_);
|
||||
|
@ -428,7 +428,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
NSDebugMLLog(@"sessions",@"_transactionRecord2=%@",_transactionRecord);
|
||||
_page=[_transactionRecord responsePage];
|
||||
LOGAssertGood(_page);
|
||||
GSWLogAssertGood(_page);
|
||||
};
|
||||
NSDebugMLLog(@"sessions",@"_transactionRecord3=%@",_transactionRecord);
|
||||
NSDebugMLLog(@"sessions",@"_page 1=%@",_page);
|
||||
|
@ -477,22 +477,18 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
id _deletePage=nil;
|
||||
NSString* _deleteContextID=nil;
|
||||
GSWLogCStdOut("Deleting permanent cached Page\n");
|
||||
GSWLogC("Deleting permanent cached Page\n");
|
||||
[GSWApplication statusLogWithFormat:@"Deleting permanent cached Page"];
|
||||
_deleteContextID=[permanentContextIDArray objectAtIndex:0];
|
||||
LOGAssertGood(_deleteContextID);
|
||||
GSWLogStdOut([NSString stringWithFormat:@"permanentContextIDArray=%@",permanentContextIDArray]);
|
||||
GSWLog([NSString stringWithFormat:@"permanentContextIDArray=%@",permanentContextIDArray]);
|
||||
GSWLogStdOut([NSString stringWithFormat:@"contextID=%@",_deleteContextID]);
|
||||
GSWLog([NSString stringWithFormat:@"contextID=%@",_deleteContextID]);
|
||||
GSWLogAssertGood(_deleteContextID);
|
||||
[GSWApplication statusLogWithFormat:@"permanentContextIDArray=%@",permanentContextIDArray];
|
||||
[GSWApplication statusLogWithFormat:@"contextID=%@",_deleteContextID];
|
||||
NSDebugMLLog(@"sessions",@"_deleteContextID=%@",_deleteContextID);
|
||||
NSDebugMLLog(@"sessions",@"[permanentContextIDArray objectAtIndex:0]=%@",[permanentContextIDArray objectAtIndex:0]);
|
||||
NSDebugMLLog(@"sessions",@"[permanentContextIDArray objectAtIndex:0] retainCount=%d",(int)[[permanentContextIDArray objectAtIndex:0] retainCount]);
|
||||
[permanentContextIDArray removeObjectAtIndex:0];
|
||||
_deletePage=[contextRecords objectForKey:_deleteContextID];
|
||||
LOGAssertGood(_deletePage);
|
||||
GSWLogStdOut([NSString stringWithFormat:@"delete page of class=%@",[_deletePage class]]);
|
||||
GSWLog([NSString stringWithFormat:@"delete page of class=%@",[_deletePage class]]);
|
||||
GSWLogAssertGood(_deletePage);
|
||||
[GSWApplication statusLogWithFormat:@"delete page of class=%@",[_deletePage class]];
|
||||
[_permanentPageCache removeObjectForKey:_deleteContextID];
|
||||
};
|
||||
_contextID=[_context contextID];
|
||||
|
@ -528,8 +524,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
__contextID=[permanentContextIDArray objectAtIndex:i];
|
||||
__object=[_permanentPageCache objectForKey:__contextID];
|
||||
GSWLogStdOut([NSString stringWithFormat:@"%d contextID=%@ page class=%@",i,__contextID,[__object class]]);
|
||||
GSWLog([NSString stringWithFormat:@"%d contextID=%@ page class=%@",i,__contextID,[__object class]]);
|
||||
[GSWApplication statusLogWithFormat:@"%d contextID=%@ page class=%@",i,__contextID,[__object class]];
|
||||
};
|
||||
};
|
||||
if ([permanentContextIDArray count]!=[_permanentPageCache count])
|
||||
|
@ -787,23 +782,19 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
id _deleteRecord=nil;
|
||||
NSString* _deleteContextID=nil;
|
||||
GSWLogCStdOut("Deleting cached Page\n");
|
||||
GSWLogC("Deleting cached Page\n");
|
||||
[GSWApplication statusLogWithFormat:@"Deleting cached Page"];
|
||||
_deleteContextID=[contextArrayStack objectAtIndex:0];
|
||||
LOGAssertGood(_deleteContextID);
|
||||
GSWLogStdOut([NSString stringWithFormat:@"contextArrayStack=%@",contextArrayStack]);
|
||||
GSWLog([NSString stringWithFormat:@"contextArrayStack=%@",contextArrayStack]);
|
||||
GSWLogStdOut([NSString stringWithFormat:@"contextID=%@",_deleteContextID]);
|
||||
GSWLog([NSString stringWithFormat:@"contextID=%@",_deleteContextID]);
|
||||
GSWLogAssertGood(_deleteContextID);
|
||||
[GSWApplication statusLogWithFormat:@"contextArrayStack=%@",contextArrayStack];
|
||||
[GSWApplication statusLogWithFormat:@"contextID=%@",_deleteContextID];
|
||||
NSDebugMLLog(@"sessions",@"_deleteContextID=%@",_deleteContextID);
|
||||
NSDebugMLLog(@"sessions",@"[contextArrayStack objectAtIndex:0]=%@",[contextArrayStack objectAtIndex:0]);
|
||||
NSDebugMLLog(@"sessions",@"[contextArrayStack objectAtIndex:0] retainCount=%d",(int)[[contextArrayStack objectAtIndex:0] retainCount]);
|
||||
[contextArrayStack removeObjectAtIndex:0];
|
||||
_deleteRecord=[contextRecords objectForKey:_deleteContextID];
|
||||
LOGAssertGood(_deleteRecord);
|
||||
LOGAssertGood([_deleteRecord responsePage]);
|
||||
GSWLogStdOut([NSString stringWithFormat:@"delete page of class=%@",[[_deleteRecord responsePage] class]]);
|
||||
GSWLog([NSString stringWithFormat:@"delete page of class=%@",[[_deleteRecord responsePage] class]]);
|
||||
GSWLogAssertGood(_deleteRecord);
|
||||
GSWLogAssertGood([_deleteRecord responsePage]);
|
||||
[GSWApplication statusLogWithFormat:@"delete page of class=%@",[[_deleteRecord responsePage] class]];
|
||||
[contextRecords removeObjectForKey:_deleteContextID];
|
||||
};
|
||||
|
||||
|
@ -849,8 +840,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
__contextID=[contextArrayStack objectAtIndex:i];
|
||||
__trecord=[contextRecords objectForKey:__contextID];
|
||||
GSWLogStdOut([NSString stringWithFormat:@"%d contextID=%@ page class=%@",i,__contextID,[[__trecord responsePage] class]]);
|
||||
GSWLog([NSString stringWithFormat:@"%d contextID=%@ page class=%@",i,__contextID,[[__trecord responsePage] class]]);
|
||||
[GSWApplication statusLogWithFormat:@"%d contextID=%@ page class=%@",i,__contextID,[[__trecord responsePage] class]];
|
||||
};
|
||||
};
|
||||
if ([contextArrayStack count]!=[contextRecords count])
|
||||
|
|
|
@ -153,7 +153,7 @@ static char rcsId[] = "$Id$";
|
|||
GSWSession* _session=nil;
|
||||
LOGObjectFnStart();
|
||||
_session=[context_ existingSession];
|
||||
LOGAssertGood(_session);
|
||||
GSWLogAssertGood(_session);
|
||||
NSDebugMLLog(@"sessions",@"_session=%@",_session);
|
||||
NS_DURING
|
||||
{
|
||||
|
@ -166,7 +166,7 @@ static char rcsId[] = "$Id$";
|
|||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
LOGAssertGood(_session);
|
||||
GSWLogAssertGood(_session);
|
||||
NSDebugMLLog(@"sessions",@"_session=%@",_session);
|
||||
NS_DURING
|
||||
{
|
||||
|
@ -179,10 +179,10 @@ static char rcsId[] = "$Id$";
|
|||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
LOGAssertGood(_session);
|
||||
GSWLogAssertGood(_session);
|
||||
NSDebugMLLog(@"sessions",@"_session=%@",_session);
|
||||
_sessionID=[_session sessionID];
|
||||
LOGAssertGood(_session);
|
||||
GSWLogAssertGood(_session);
|
||||
NSDebugMLLog(@"sessions",@"_sessionID=%@",_sessionID);
|
||||
NS_DURING
|
||||
{
|
||||
|
|
|
@ -92,7 +92,7 @@ static char rcsId[] = "$Id$";
|
|||
NSDebugMLLog(@"sessions",@"_timer=%@",_timer);
|
||||
if (_timer)
|
||||
{
|
||||
GSWLog(@"lock Target...");
|
||||
[GSWApplication logWithFormat:@"lock Target..."];
|
||||
[target lock];
|
||||
NS_DURING
|
||||
{
|
||||
|
@ -108,7 +108,7 @@ static char rcsId[] = "$Id$";
|
|||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
GSWLog(@"unlock Target...");
|
||||
[GSWApplication logWithFormat:@"unlock Target..."];
|
||||
[target unlock];
|
||||
};
|
||||
}
|
||||
|
@ -128,8 +128,7 @@ static char rcsId[] = "$Id$";
|
|||
-(void)handleTimer:(id)timer_
|
||||
{
|
||||
//OK
|
||||
GSWLogCStdOut("Start HandleTimer");
|
||||
GSWLogC("Start HandleTimer");
|
||||
[GSWApplication statusLogWithFormat:@"Start HandleTimer"];
|
||||
// LOGObjectFnStart();
|
||||
[GSWApp lockRequestHandling];
|
||||
NS_DURING
|
||||
|
@ -213,8 +212,7 @@ static char rcsId[] = "$Id$";
|
|||
NS_ENDHANDLER;
|
||||
[GSWApp unlockRequestHandling];
|
||||
// LOGObjectFnStop();
|
||||
GSWLogCStdOut("Stop HandleTimer");
|
||||
GSWLogC("Stop HandleTimer");
|
||||
[GSWApplication statusLogWithFormat:@"Stop HandleTimer"];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
|
|
@ -115,7 +115,7 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(GSWComponent*)responsePage
|
||||
{
|
||||
LOGAssertGood(self);
|
||||
GSWLogAssertGood(self);
|
||||
return responsePage;
|
||||
};
|
||||
|
||||
|
|
|
@ -42,7 +42,17 @@
|
|||
#define VOID_RCSID \
|
||||
static void VoidUseRCSId() { rcsId[0]=0; };
|
||||
|
||||
#ifndef BYTE_DEFINED
|
||||
typedef unsigned char BYTE;
|
||||
#define BYTE_DEFINED
|
||||
#endif
|
||||
#ifndef UINTs_DEFINED
|
||||
typedef unsigned int UINT;
|
||||
typedef unsigned char UINT8;
|
||||
typedef unsigned short UINT16;
|
||||
typedef unsigned int UINT32;
|
||||
#define UINTs_DEFINED
|
||||
#endif
|
||||
|
||||
#define allFrameworks tmpAllFrameworks
|
||||
|
||||
|
@ -166,7 +176,6 @@ extern NSString* GSWGetDefaultDocRoot();
|
|||
//To Move
|
||||
extern NSString* DataToHexString(NSData* data);
|
||||
extern NSData* HexStringToData(NSString* _string);
|
||||
extern NSString* MD5HexDigest(NSString* str);
|
||||
|
||||
//====================================================================
|
||||
@interface NSException (NSBuild)
|
||||
|
|
|
@ -25,8 +25,8 @@ static char rcsId[] = "$Id$";
|
|||
|
||||
#include <gsweb/GSWeb.framework/GSWeb.h>
|
||||
|
||||
#include <gnustep/base/md5.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include "stacktrace.h"
|
||||
#include "attach.h"
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -143,20 +143,6 @@ BOOL SBIsValueEqual(id id1,id id2)
|
|||
return _equal;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
NSString* MD5HexDigest(NSString* str)
|
||||
{
|
||||
int i=0;
|
||||
NSMutableString* digest=[NSMutableString stringWithCapacity:32];
|
||||
unsigned char digestNb[16];
|
||||
md5_buffer([str cString],[str length],digestNb);
|
||||
for(i=0;i<16;i++)
|
||||
{
|
||||
[digest appendFormat:@"%02x",(unsigned int)digestNb[i]];
|
||||
};
|
||||
return digest;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
id GetTmpName(NSString* dir,NSString* prefix)
|
||||
{
|
||||
|
@ -257,7 +243,7 @@ void pidstat(pid_t pid, proc_t* P)
|
|||
memset(P->cmd, 0, sizeof P->cmd); // clear even though *P xcalloc'd ?!
|
||||
sscanf(S, "%d (%39c", &P->pid, P->cmd);
|
||||
*/
|
||||
char* _statsChars=[_stats cString];
|
||||
const char* _statsChars=[_stats cString];
|
||||
NSDebugFLog(@"_stats=%@",_stats);
|
||||
sscanf(_statsChars,
|
||||
"%c %d %d %d %d %d %lu %lu %lu %lu %lu %ld %ld %ld %ld %d "
|
||||
|
@ -295,7 +281,7 @@ void pidstatm(pid_t pid, proc_t* P)
|
|||
NSDebugFLog(@"pid=%d",(int)pid);
|
||||
if (pidstat)
|
||||
{
|
||||
char* _statsChars=[pidstat cString];
|
||||
const char* _statsChars=[pidstat cString];
|
||||
NSDebugFLog(@"pidstat=%@",pidstat);
|
||||
sscanf(_statsChars, "%ld %ld %ld %ld %ld %ld %ld",
|
||||
&P->size, &P->resident, &P->share,
|
||||
|
|
|
@ -49,9 +49,9 @@ ADDITIONAL_INCLUDE_DIRS = -I. -I$(GNUSTEP_SYSTEM_ROOT)/db -I../..
|
|||
|
||||
# Additional LDFLAGS to pass to the linker
|
||||
ifeq ($(debug), yes)
|
||||
ADDITIONAL_LDFLAGS = -lFoundationExt_d -lNGReflection_d
|
||||
ADDITIONAL_LDFLAGS = -lFoundationExt_d
|
||||
else
|
||||
ADDITIONAL_LDFLAGS = -lFoundationExt -lNGReflection
|
||||
ADDITIONAL_LDFLAGS = -lFoundationExt
|
||||
endif
|
||||
|
||||
# Additional library directories the linker should search
|
||||
|
|
69
INSTALL
69
INSTALL
|
@ -6,10 +6,10 @@ This file documents the installation of GNUstepWeb, `gsweb'. Copyright
|
|||
modify it freely as long as you preserve this copyright notice and
|
||||
permission notice.
|
||||
|
||||
This is version 1.0.0 of GNUstepWeb.
|
||||
This is version 1.1.0 of GNUstepWeb.
|
||||
|
||||
This package contains GNUstepWeb library. You need to install
|
||||
GNUstep core and db libraries, GSWAdaptor and Apache
|
||||
GNUstep core, extensions and db libraries, GSWAdaptor and Apache
|
||||
Please download last up to date cvs version of GNUstep (some bugs
|
||||
have been corrected).
|
||||
|
||||
|
@ -26,7 +26,6 @@ Installing `gsweb'
|
|||
core/ GNUstep core
|
||||
db/ GNUstep database
|
||||
extensions/ Extensions
|
||||
You also need NGReflection
|
||||
|
||||
The GNUStepWeb package:
|
||||
-----------------------
|
||||
|
@ -41,11 +40,9 @@ Installing `gsweb'
|
|||
------------------
|
||||
|
||||
1) core
|
||||
After the compilation ok, and the 'make install', copy core/base/Sources/md5.h on your GNUstep's Header folder:
|
||||
/usr/GNUstep/Headers/gnustep/base/md5.h
|
||||
|
||||
2) extensions
|
||||
It adds the Header exceptions folders (both in Foundation an extensions)
|
||||
It adds the Header exceptions folders (both in Foundation and extensions)
|
||||
|
||||
3) db
|
||||
4) gsantlr
|
||||
|
@ -53,17 +50,12 @@ Installing `gsweb'
|
|||
Extract and compile
|
||||
|
||||
6) gsgd
|
||||
7) NGReflection
|
||||
you can find it on ftp://ftp.gnustep.org/pub/gnustep/contrib/MOF2-fd-1999-11-03.tgz.
|
||||
Remark that this archive contains many extension. GNUstepWeb only needs the Reflections objects.
|
||||
So after the untar, go to MOF2/Foundation/NGReflection. Type make, them make install.
|
||||
You can install the others but some are not in phase with GNUstep present libraries.
|
||||
|
||||
8) GNUstepWeb
|
||||
Go in the GNUStepWeb folder. make and make install.
|
||||
Go in the GNUstepWeb folder. make and make install.
|
||||
|
||||
9) Apaches modules for GNUStepWeb
|
||||
Still in the GNUStepWeb folder there is a GSWAdaptors/Apache folder, go in and make. There no make install. Instead You must copy the mod_gsweb.so module in you Apache libexec directory (something like usr/apache/libexec).
|
||||
9) Apaches modules for GNUstepWeb
|
||||
Still in the GNUstepWeb folder there is a GSWAdaptors/Apache folder, go in and make. There no make install. Instead you must copy the mod_gsweb.so module in you Apache libexec directory (something like /usr/apache/libexec).
|
||||
|
||||
At this point everything is done, still remains the Apache configuration:
|
||||
|
||||
|
@ -78,33 +70,42 @@ Configurating Apache:
|
|||
LoadModule GSWeb_Module libexec/mod_gsweb.so
|
||||
AddModule mod_gsweb.c
|
||||
|
||||
And this one to specify the configuration file (for exemple /etc/httpd/conf/gsweb.conf)
|
||||
|
||||
If you use virtual hosts (Apache in localhost doiues not requiered them), add the following lines:
|
||||
GSWeb_ConfigFilePath /etc/httpd/conf/gsweb.conf
|
||||
|
||||
|
||||
If you use virtual hosts (Apache in localhost does not requiered them), add the following lines:
|
||||
|
||||
<Location /GSWeb*>
|
||||
SetHandler GSWeb
|
||||
</Location>
|
||||
|
||||
Next if /etc/httpd/conf folders does not exist, you have to create them.
|
||||
In this folder create an file file named gsweb-log (that will be GNUStepWeb reports file)
|
||||
Then, create the file /etc/httpd/conf/gsweb.conf which contains parameters for GNUstepWeb Applications:
|
||||
Then, create the file configuration file (for exemple /etc/httpd/conf/gsweb.conf) which contains parameters for GNUstepWeb Applications:
|
||||
|
||||
The format is(there is an example for values below):
|
||||
|
||||
The format is (there is an example for values below):
|
||||
{
|
||||
canDumpStatus=YES; //YES if server can display status (URL: /GSWeb/status)
|
||||
GSWExtensionsFrameworkWebServerResources="/GSW/GSWExtensions/WebServerResources"; //URL of GSWExtensions Framework WebServerResources directory
|
||||
|
||||
applications= {
|
||||
ApplicationName = {
|
||||
instances = (
|
||||
{
|
||||
instanceNum= InstanceNumber;
|
||||
//URL of GSWExtensions Framework WebServerResources directory. It overides Global parameter
|
||||
GSWExtensionsFrameworkWebServerResources="/GSW/GSWExtensions/WebServerResources";
|
||||
|
||||
//YES to say that this application can be listed when the adaptor don't find an application
|
||||
canDump = YES;
|
||||
|
||||
instances = {
|
||||
InstanceNumber = {
|
||||
host= IPAdressOfTheComputerOnWhichRunTheApplication;
|
||||
port= ThePortListenByTheApplication;
|
||||
parameters= {
|
||||
transport= socket;
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -112,18 +113,20 @@ The format is (there is an example for values below):
|
|||
|
||||
exemple values for a localhost use:
|
||||
{
|
||||
canDumpStatus=YES;
|
||||
GSWExtensionsFrameworkWebServerResources="/GSW/GSWExtensions/WebServerResources";
|
||||
applications= {
|
||||
MyApp = {
|
||||
instances = (
|
||||
{
|
||||
instanceNum= 1;
|
||||
host= 127.0.0.1;
|
||||
port= 9001;
|
||||
parameters= {
|
||||
transport= socket;
|
||||
};
|
||||
}
|
||||
);
|
||||
canDump = YES;
|
||||
instances = {
|
||||
1 = {
|
||||
host= 127.0.0.1;
|
||||
port= 9001;
|
||||
parameters= {
|
||||
transport= socket;
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
2
README
2
README
|
@ -1,7 +1,7 @@
|
|||
README
|
||||
******
|
||||
|
||||
This is version 1.0.0 of GNUstepWeb (`gsweb').
|
||||
This is version 1.1.0 of GNUstepWeb (`gsweb').
|
||||
|
||||
GNUstepWeb is a library which was designed to be compatible with
|
||||
WebObjects 4.x (developed by NeXT (now Apple) Inc.).
|
||||
|
|
Loading…
Reference in a new issue