* fixed memory leak

* ported to OS X (beta)
* depricated GSW naming



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@30215 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
dwetzel 2010-04-22 04:28:50 +00:00
parent de6161cec0
commit 0afcd2ae8d
85 changed files with 375 additions and 439 deletions

View file

@ -1,3 +1,8 @@
2010-04-16 David Wetzel <dave@turbocat.de>
* fixed memory leak
* ported to OS X (beta)
* depricated GSW naming
2010-04-16 David Wetzel <dave@turbocat.de>
GSWeb.framework
* Many warnings fixed.

View file

@ -23,7 +23,7 @@
#
include $(GNUSTEP_MAKEFILES)/common.make
include $(GNUSTEP_MAKEFILES)/Auxiliary/gsweb.make
include $(GNUSTEP_MAKEFILES)/Auxiliary/gsweb_wo.make
GSWAPP_NAME=Hello
@ -34,7 +34,7 @@ Hello_GSWAPP_INFO_PLIST=Resources/Info-Hello.plist
# The Objective-C source files to be compiled
Hello_OBJC_FILES = Hello_main.m Hello.m HelloPage.m Main.m
Hello_COMPONENTS = Main.gswc HelloPage.gswc
Hello_COMPONENTS = Main.wo HelloPage.wo
SRCS = $(GSWAPP_NAME:=.m)
@ -42,6 +42,13 @@ HDRS =
DIST_FILES = $(SRCS) $(HDRS) GNUmakefile Makefile.postamble Makefile.preamble
AUXILIARY_GSW_LIBS = -framework WebObjects -framework WOExtensions
#else
#AUXILIARY_GSW_LIBS += -lWebObjects -lWOExtensions
#endif
-include Makefile.preamble
include $(GNUSTEP_MAKEFILES)/gswapp.make

View file

@ -1,3 +1,6 @@
//====================================================================
#include <WebObjects/WebObjects.h>
@interface Hello : GSWApplication
@end

View file

@ -2,9 +2,13 @@
#include <GNUstepBase/GNUstep.h>
#endif
#include <GSWeb/GSWeb.h>
#include "Hello.h"
@implementation Hello
+(NSNumber*)sessionTimeOut
{
return [NSNumber numberWithInt:60];
}
@end

View file

@ -10,9 +10,9 @@
*/
#include <GSWeb/GSWeb.h>
#include <WebObjects/WebObjects.h>
@interface HelloPage:GSWComponent
@interface HelloPage:WOComponent
{
NSString *nameString;
}

View file

@ -3,6 +3,6 @@
<TITLE>Hello World!</TITLE>
</HEAD>
<BODY>
Hello <GSWEB NAME=BODY_NAME_STRING></GSWEB>!
Hello <webobject NAME=body_name_string></webobject>!
</BODY>
</HTML>

View file

@ -9,4 +9,7 @@
* HelloWorld ObjC application.
*/
BODY_NAME_STRING:GSWString {value = nameString}
body_name_string:WOString
{
value = nameString
}

View file

@ -1,4 +1,3 @@
{
encoding = NSUTF8StringEncoding;
variables = {};
}

View file

@ -2,13 +2,13 @@
#include <GNUstepBase/GNUstep.h>
#endif
#include <GSWeb/GSWeb.h>
#include <WebObjects/WebObjects.h>
int main(int argc, const char *argv[])
{
int ret=0;
NSAutoreleasePool *arp = [NSAutoreleasePool new];
ret=GSWApplicationMain(@"Hello", argc, argv);
ret=WOApplicationMain(@"Hello", argc, argv);
[arp release];
return ret;
}

View file

@ -1,13 +0,0 @@
<HTML>
<HEAD>
<TITLE>Hello World!</TITLE>
</HEAD>
<BODY>
<GSWEB NAME=MyForm>
What's your name?
<P>
<GSWEB NAME=NAME_FIELD></GSWEB>
<GSWEB NAME=SUBMIT_BUTTON><INPUT TYPE="SUBMIT"></GSWEB>
</GSWEB>
</BODY>
</HTML>

View file

@ -13,6 +13,8 @@
#include <GNUstepBase/GNUstep.h>
#endif
#include <WebObjects/WebObjects.h>
#include "Main.h"
#include "Hello.h"
#include "HelloPage.h"

View file

@ -0,0 +1,13 @@
<HTML>
<HEAD>
<TITLE>Hello World!</TITLE>
</HEAD>
<BODY>
<webobject name=form>
What's your name?
<P>
<webobject name=name_field></webobject>
<webobject name=submit_button><INPUT TYPE="SUBMIT"></webobject>
</webobject>
</BODY>
</HTML>

View file

@ -11,9 +11,9 @@
*
*/
NAME_FIELD:GSWTextField {value = nameString}
name_field:WOTextField {value = nameString}
SUBMIT_BUTTON:GSWSubmitButton {action = sayHello}
submit_button:WOSubmitButton {action = sayHello}
MyForm: GSWForm {
form: WOForm {
}

View file

@ -0,0 +1 @@
{"WebObjects Release" = "WebObjects 5.0"; encoding = NSUTF8StringEncoding; }

View file

@ -55,7 +55,7 @@
GSWAssociation * _key;
GSWAssociation * _width;
GSWAssociation * _height;
GSWAssociation * _secure;
// GSWAssociation * _secure;
GSWAssociation * _actionClass;
GSWAssociation * _directActionName;
NSDictionary * _sessionIDQueryAssociations;

View file

@ -264,7 +264,7 @@ static NSString * static_tempQueryKey = nil;
DESTROY(_key);
DESTROY(_width);
DESTROY(_height);
DESTROY(_secure);
// DESTROY(_secure);
DESTROY(_actionClass);
DESTROY(_directActionName);
DESTROY(_sessionIDQueryAssociations);
@ -282,7 +282,7 @@ static NSString * static_tempQueryKey = nil;
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -27,7 +27,7 @@
#define _GSWAdaptor_h__
#include <Foundation/NSObject.h>
@class NSDictionary;
//====================================================================
// GSWAdaptor

View file

@ -91,6 +91,7 @@ GSWEB_EXPORT BOOL WOStrictFlag;
NSMutableDictionary* _requestHandlers;
GSWRequestHandler* _defaultRequestHandler;
NSString* _hostAddress;
NSMutableDictionary* _contextDictionary;
@public //TODO-NOW REMOVE
NSRecursiveLock* _selfLock;
#ifndef NDEBUG

View file

@ -282,9 +282,6 @@ int GSWApplicationMain(NSString* applicationClassName,
ASSIGN(_lastAccessDate,[NSDate date]);
[self setTimeOut:0];//No time out
NSDebugMLLog(@"application",@"GSCurrentThreadDictionary()=%@",
GSCurrentThreadDictionary());
//Do it before run so application can addTimer,... in -run
NSDebugMLLog(@"application",@"[NSRunLoop currentRunLoop]=%@",[NSRunLoop currentRunLoop]);
ASSIGN(_currentRunLoop,[NSRunLoop currentRunLoop]);
@ -301,6 +298,7 @@ int GSWApplicationMain(NSString* applicationClassName,
[[self class] _setApplication:self];
[self _touchPrincipalClasses];
_contextDictionary = [NSMutableDictionary new];
standardUserDefaults=[NSUserDefaults standardUserDefaults];
NSDebugMLLog(@"options",@"standardUserDefaults=%@",standardUserDefaults);
@ -414,6 +412,8 @@ int GSWApplicationMain(NSString* applicationClassName,
DESTROY(_initialTimer);
DESTROY(_activeSessionsCountLock);
DESTROY(_lifebeatThread);
DESTROY(_contextDictionary);
if (GSWApp == self)
{
GSWApp = nil;
@ -449,7 +449,7 @@ int GSWApplicationMain(NSString* applicationClassName,
[self lock];
dscr=[NSString stringWithFormat:
@"<%s %p - name=%@ adaptors=%@ sessionStore=%@ pageCacheSize=%d permanentPageCacheSize=%d pageRecreationEnabled=%s pageRefreshOnBacktrackEnabled=%s componentDefinitionCache=%@ caching=%s terminating=%s timeOut=%f dynamicLoadingEnabled=%s>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
[self name],
[[self adaptors] description],
@ -1470,33 +1470,31 @@ int GSWApplicationMain(NSString* applicationClassName,
//--------------------------------------------------------------------
-(void)_setContext:(GSWContext*)aContext
{
NSMutableDictionary* threadDictionary=nil;
SYNCHRONIZED(self) {
if (aContext) {
[_contextDictionary setObject:aContext
forKey:GSWThreadKey_Context];
} else {
[_contextDictionary removeObjectForKey:GSWThreadKey_Context];
}
}
END_SYNCHRONIZED;
threadDictionary=GSCurrentThreadDictionary();
if (aContext)
[threadDictionary setObject:aContext
forKey:GSWThreadKey_Context];
else
[threadDictionary removeObjectForKey:GSWThreadKey_Context];
// ASSIGN(context,_context);
NSDebugMLLog(@"application",@"context:%p",(void*)aContext);
NSDebugMLLog(@"application",@"context retain count:%p",[aContext retainCount]);
};
}
//--------------------------------------------------------------------
// Internal Use only
-(GSWContext*)_context
{
GSWContext* context=nil;
NSMutableDictionary* threadDictionary=nil;
threadDictionary=GSCurrentThreadDictionary();
context=[threadDictionary objectForKey:GSWThreadKey_Context];
NSDebugMLLog(@"application",@"context:%p",(void*)context);
SYNCHRONIZED(self) {
context=[_contextDictionary objectForKey:GSWThreadKey_Context];
}
END_SYNCHRONIZED;
return context;
};
}
//--------------------------------------------------------------------
@ -1742,7 +1740,7 @@ to another instance **/
// We can't set the editing context if one has already been created
[NSException raise:NSInvalidArgumentException
format:@"%s Can't set a sessionStore when one already exists",
object_get_class_name(self)];
object_getClassName(self)];
}
else
{

View file

@ -55,7 +55,8 @@ RCS_ID("$Id$")
DESTROY(_string);
if (_uniBuf)
{
objc_free(_uniBuf);
//objc_free(_uniBuf);
free(_uniBuf);
_uniBuf=NULL;
};
[super dealloc];

View file

@ -95,7 +95,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - parentBindingName=%@ negate:%d keyPath=%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_parentBindingName,
_negate,

View file

@ -77,7 +77,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -161,7 +161,7 @@ static SEL valueInComponentSEL = NULL;
-(id) description
{
return [NSString stringWithFormat:@"<%s %p list:%@ item:%@ displayString:%@ selections:%@ selectedValues:%@ multiple:%@ size:%@ escapeHTML:%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_list, _item, _displayString, _selections, _selectedValues, _multiple,
_size, _escapeHTML];

View file

@ -177,7 +177,7 @@ RCS_ID("$Id$")
// GSWLogC("GSWBundle description A");
// NSDebugMLLog(@"bundles",@"GSWBundle description Self=%p",self);
descr=[NSString stringWithFormat:@"<%s %p - ",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
// GSWLogC("GSWBundle description B");
descr=[descr stringByAppendingFormat:@"path:[%@] ",

View file

@ -113,7 +113,7 @@ static Class standardClass = Nil;
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -167,7 +167,7 @@ static Class standardClass = Nil;
-(id) description
{
return [NSString stringWithFormat:@"<%s %p list:%@ item:%@ index:%@ selections:%@ prefix:%@ suffix:%@ displayString:%@ escapeHTML:%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_list, _item, _index,
_selections, _prefix, _suffix, _displayString, _escapeHTML];

View file

@ -60,7 +60,7 @@ static Class GSWHTMLBareStringClass = Nil;
-(id)init
{
// NSLog(@"%s init: deprecated. use initWithContext", class_get_class_name([self class]));
// NSLog(@"%s init: deprecated. use initWithContext", class_getName([self class]));
return [self initWithContext:[GSWComponentDefinition TheTemporaryContext]];
}
@ -82,9 +82,9 @@ static Class GSWHTMLBareStringClass = Nil;
if (myClass == ([GSWComponent class])) {
ASSIGN(_name, [aContext _componentName]);
} else {
ASSIGN(_name, [NSString stringWithCString:object_get_class_name(self)]);
ASSIGN(_name, [NSString stringWithCString:object_getClassName(self)]);
}
ASSIGN(_templateName,[NSString stringWithCString:class_get_class_name(myClass)]);
ASSIGN(_templateName,[NSString stringWithCString:class_getName(myClass)]);
_isPage = NO;
_subComponents = nil;
[self setCachingEnabled:[GSWApp isCachingEnabled]];
@ -289,7 +289,7 @@ static Class GSWHTMLBareStringClass = Nil;
NSString* dscr=nil;
dscr=[NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
return dscr;

View file

@ -232,7 +232,7 @@ static GSWContext * TheTemporaryContext;
{
//TODO
return [NSString stringWithFormat:@"<%s %p - name:[%@] bundle:[%@] frameworkName=[%@] componentClass=[%@] isCachingEnabled=[%s] isAwake=[%s]>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_name,
_bundle,
@ -333,7 +333,7 @@ static GSWContext * TheTemporaryContext;
componentInitIMP = [GSWComponent instanceMethodForSelector:@selector(init)];
if (instanceInitIMP != componentInitIMP) {
// NSLog(@"Class %s should implement initWithContext: and not init", object_get_class_name(myClass));
// NSLog(@"Class %s should implement initWithContext: and not init", object_getClassName(myClass));
[ComponentConstructorLock lock];
locked = YES;
TheTemporaryContext = aContext;

View file

@ -37,6 +37,11 @@
{
}
/*
returns YES. Subclassers might override this.
*/
- (BOOL) rejectFavicon;
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
+(id)handler;

View file

@ -289,20 +289,36 @@ GSWResponse * _dispatchWithPreparedApplication(GSWApplication *app, GSWContext *
return response;
}
- (BOOL) rejectFavicon
{
return YES;
}
- (GSWResponse*) _handleRequest:(GSWRequest*) aRequest
{
GSWContext * aContext = nil;
NSDictionary * requestHandlerValues;
NSString * aSessionID;
NSString * aSenderID;
NSString * uri;
NSString * oldContextID;
GSWStatisticsStore * aStatisticsStore;
GSWResponse * aResponse;
GSWApplication * app = GSWApp; // is there any reason not to use the global var? -- dw
uri = [aRequest uri];
if ([self rejectFavicon] && uri != nil) {
if ([@"/favicon.ico" isEqualToString:uri]) {
aResponse = [app createResponseInContext:nil];
[aResponse setStatus:404]; // sorry kids
return aResponse;
}
}
requestHandlerValues = [self requestHandlerValuesForRequest:aRequest];
aSessionID = [requestHandlerValues objectForKey:[app sessionIdKey]];
if ((aSessionID == nil) && [app isRefusingNewSessions])
{
NSString * newLocationURL = [app _newLocationForRequest:aRequest];

View file

@ -98,7 +98,7 @@ static Class standardClass = Nil;
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p condition: %@ negate: %@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self, _condition, _negate];
};

View file

@ -70,7 +70,7 @@ RCS_ID("$Id$")
-(NSString*)debugDescription
{
NSString* dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_value,
[_value class]];
@ -114,7 +114,7 @@ RCS_ID("$Id$")
GSWLogAssertGood(_value);
};
dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_value,
[_value class]];

View file

@ -412,7 +412,7 @@ GSWEB_EXPORT BOOL GSWContext_isSenderIDSearchOver(GSWContext* aContext)
dontTraceComponentActionURL++;
desc= [NSString stringWithFormat:
@"%s: %p contextID=%@ senderID=%@ elementID=%@ session=%p request=%p response=%p pageElement=%p pageComponent=%p currentComponent=%p url=%@ urlApplicationNumber=%d isClientComponentRequest=%s distributionEnabled=%s isSessionDisabled=%s pageChanged=%s pageReplaced=%s",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
[self contextID],
[self senderID],

View file

@ -112,14 +112,14 @@ NSString* IVarInString(const char* aType,void* aValue)
{
Class* pvalue=(Class*)aValue;
return [NSString stringWithFormat:@"Class:%s",
class_get_class_name(*pvalue)];
class_getName(*pvalue)];
};
break;
case _C_SEL:
{
SEL* pvalue=(SEL*)aValue;
return [NSString stringWithFormat:@"SEL:%s",
sel_get_name(*pvalue)];
sel_getName(*pvalue)];
};
break;
case _C_CHR:

View file

@ -118,7 +118,7 @@ return self;
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p name:[%@] type:[%@] associations:\n%@",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_name,
_type,

View file

@ -454,8 +454,11 @@ inline GSWDeclaration* parseDeclaration(GSWDeclarationParser* parser)
{
if (!_declarations)
_declarations=(NSMutableDictionary*)[NSMutableDictionary new];
// does not work on Snow Leopard. Any suggestions? -- dw
// _uniBuf = (unichar*)objc_malloc(sizeof(unichar)*(_length+1));
_uniBuf = (unichar*)malloc(sizeof(unichar)*(_length+1));
_uniBuf = (unichar*)objc_malloc(sizeof(unichar)*(_length+1));
NS_DURING
{
[_string getCharacters:_uniBuf];
@ -498,7 +501,8 @@ inline GSWDeclaration* parseDeclaration(GSWDeclarationParser* parser)
{
if (_uniBuf)
{
objc_free(_uniBuf);
//objc_free(_uniBuf);
free(_uniBuf);
_uniBuf=NULL;
};
[localException raise];

View file

@ -41,22 +41,27 @@
#include "GSWWorkerThread.h"
#if HAVE_LIBWRAP
#include <tcpd.h>
#include <syslog.h>
#ifndef GNUSTEP
#include <GNUstepBase/NSFileHandle+GNUstepBase.h>
#endif
//#if HAVE_LIBWRAP
//#include <tcpd.h>
//#include <syslog.h>
//#endif
RCS_ID("$Id$")
#if HAVE_LIBWRAP
int deny_severity = LOG_WARNING;
int allow_severity = LOG_INFO;
/*static*/ void twist_option(char *value,struct request_info *request)
{
};
#endif
//#if HAVE_LIBWRAP
//int deny_severity = LOG_WARNING;
//int allow_severity = LOG_INFO;
///*static*/ void twist_option(char *value,struct request_info *request)
//{
//};
//#endif
static GSWResponse * static_lastDitchErrorResponse = nil;
@ -145,13 +150,20 @@ static GSWResponse * static_lastDitchErrorResponse = nil;
#ifndef __APPLE__
NSAssert([_fileHandle readInProgress],@"No [_fileHandle readInProgress]");
NSDebugDeepMLog(@"%@ - B readInProgress=%d", GSCurrentThread(),(int)[_fileHandle readInProgress]);
// NSDebugDeepMLog(@"%@ - B readInProgress=%d", GSCurrentThread(),(int)[_fileHandle readInProgress]);
#endif
NSLog(@"Thread XX Waiting for connections on %@:%d.",
// [GSCurrentThread() description],
_host,
_port);
#if 0
[GSWApplication statusLogWithFormat:
@"Thread %@: Waiting for connections on %@:%d.",
GSCurrentThread(),
[GSCurrentThread() description],
_host,
_port];
#endif
}
END_SYNCHRONIZED;
}
@ -329,7 +341,7 @@ void _queueWorkOnHandle(NSFileHandle* handle, NSMutableArray* waitingThreadArray
}
else
{
#if HAVE_LIBWRAP
#if 0 //HAVE_LIBWRAP
NSString* appName=nil;
struct request_info libwrapRequestInfo;
memset(&libwrapRequestInfo, 0, sizeof(libwrapRequestInfo));
@ -421,6 +433,15 @@ void _queueWorkOnHandle(NSFileHandle* handle, NSMutableArray* waitingThreadArray
{
}
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p host: %@ port: %d adaptorHost: %@>",
object_getClassName(self),
(void*)self,
_host,
_port,
_adaptorHost];
}
@end

View file

@ -100,7 +100,7 @@ RCS_ID("$Id$")
NSString* descr=nil;
// GSWLogC("GSWDeployedBundle description A");
descr=[NSString stringWithFormat:@"<%s %p - ",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
// GSWLogC("GSWDeployedBundle description B");
descr=[descr stringByAppendingFormat:@"bundlePath:%@ ",

View file

@ -58,7 +58,8 @@ static inline
BOOL GSWDynamicElement_evaluateValueInContext(GSWDynamicElement* element,Class standardClass,
GSWIMP_BOOL imp,GSWAssociation* condition,GSWContext* context)
{
if (imp && object_get_class(element)==standardClass)
// was object_get_class
if (imp && object_getClass(element)==standardClass)
{
return (*imp)(element,evaluateConditionInContextSEL,
condition,context);

View file

@ -242,7 +242,7 @@ static Class GSWHTMLBareStringClass = Nil;
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p children:%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_children];
};

View file

@ -334,18 +334,7 @@ static SEL appendStringSel = NULL;
{
if (!_flags.composed)
{
if (_url)
{
int length=[_url length];
//NSDebugMLLog(@"low",@"url %p %@ class=%@",_url,_url,[_url class]);
if (length>0)
[_url deleteCharactersInRange:NSMakeRange(0,length)];
}
else
{
_url=[NSMutableString new];
_urlASImp=NULL;
};
NSString * tmpUrl = [[NSMutableString new] autorelease];
if (!_flags.beginningComposed)
{
@ -415,25 +404,33 @@ static SEL appendStringSel = NULL;
};
if (!_urlASImp)
_urlASImp = [_url methodForSelector:appendStringSel];
_urlASImp = [tmpUrl methodForSelector:appendStringSel];
(*_urlASImp)(_url,appendStringSel,_urlBeginning);
(*_urlASImp)(tmpUrl,appendStringSel,_urlBeginning);
if (_requestHandlerKey)
{
(*_urlASImp)(_url,appendStringSel,_requestHandlerKey);
(*_urlASImp)(_url,appendStringSel,@"/");
(*_urlASImp)(tmpUrl,appendStringSel,_requestHandlerKey);
(*_urlASImp)(tmpUrl,appendStringSel,@"/");
};
if (_requestHandlerPath)
{
(*_urlASImp)(_url,appendStringSel,_requestHandlerPath);
(*_urlASImp)(tmpUrl,appendStringSel,_requestHandlerPath);
};
if (_queryString)
{
(*_urlASImp)(_url,appendStringSel,@"?");
(*_urlASImp)(_url,appendStringSel,_queryString);
(*_urlASImp)(tmpUrl,appendStringSel,@"?");
(*_urlASImp)(tmpUrl,appendStringSel,_queryString);
};
_flags.composed=YES;
if (([tmpUrl length]==0)) {
NSLog(@"%s:cannot parse '%@'", __PRETTY_FUNCTION__, _url);
} else {
[_url release];
_url = [tmpUrl retain];
}
//NSDebugMLLog(@"low",@"url %@ class=%@",_url,[_url class]);
};
};

View file

@ -138,7 +138,7 @@ static Class standardClass = Nil;
-(id) description
{
return [NSString stringWithFormat:@"<%s %p action: %@ actionClass: %@ directActionName: %@ href:%@ multipleSubmit: %@ queryDictionary: %@ otherQueryAssociations: %@ >",
object_get_class_name(self),
object_getClassName(self),
(void*)self, _action, _actionClass, _directActionName, _href, _multipleSubmit,
_queryDictionary, _otherQueryAssociations];
};

View file

@ -78,7 +78,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -306,7 +306,7 @@ BOOL canBeOnSegment(NSPoint m,NSPoint a,NSPoint b)
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - userDefinedString %@ userDefinedValue %@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_userDefinedString,
_userDefinedValue];
@ -512,7 +512,7 @@ BOOL canBeOnSegment(NSPoint m,NSPoint a,NSPoint b)
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - userDefinedString %@ userDefinedValue %@ center %@ size %@ start %d stop %d>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_userDefinedString,
_userDefinedValue,
@ -905,7 +905,7 @@ BOOL canBeOnSegment(NSPoint m,NSPoint a,NSPoint b)
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - userDefinedString %@ userDefinedValue %@ rect %@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_userDefinedString,
_userDefinedValue,
@ -1003,7 +1003,7 @@ BOOL canBeOnSegment(NSPoint m,NSPoint a,NSPoint b)
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - userDefinedString %@ userDefinedValue %@ points %@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_userDefinedString,
_userDefinedValue,

View file

@ -65,7 +65,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - String:[%@]>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_string];
}

View file

@ -68,7 +68,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - String:[%@]>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_string];
};

View file

@ -493,8 +493,12 @@ May raise exception.
{
// Object obj = null;
_length=[_string length];
_uniBuf = (unichar*)objc_malloc(sizeof(unichar)*(_length+1));
// does not work on Snow Leopard. Any suggestions? -- dw
//_uniBuf = (unichar*)objc_malloc(sizeof(unichar)*(_length+1));
_uniBuf = (unichar*)malloc(sizeof(unichar)*(_length+1));
NS_DURING
{
[_string getCharacters:_uniBuf];
@ -633,7 +637,8 @@ May raise exception.
{
if (_uniBuf)
{
objc_free(_uniBuf);
//objc_free(_uniBuf);
free(_uniBuf);
_uniBuf=NULL;
};
[localException raise];

View file

@ -179,7 +179,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -26,7 +26,9 @@
#include <Foundation/NSString.h>
#include <Foundation/NSFileHandle.h>
#include <Foundation/NSData.h>
#ifdef GNUSTEP
#include <GNUstepBase/GSFileHandle.h>
#endif
#include <Foundation/NSError.h>
#include <Foundation/NSException.h>
#include <Foundation/NSDictionary.h>
@ -82,7 +84,7 @@ static BOOL _alwaysAppendContentLength = YES;
NSMutableData *d;
int got,pos=0;
char buf[READ_SIZE];
int fileDescriptor = [(GSFileHandle*)self fileDescriptor];
int fileDescriptor = [self fileDescriptor];
d = [NSMutableData dataWithCapacity: READ_SIZE];
do {
@ -257,7 +259,7 @@ void _sendMessage(GSWMessage * message, NSFileHandle* fh, NSString * httpVersion
remoteAddress:(NSString**) rAddress
remotePort:(uint16_t*) rPort
{
int fileDescriptor = [(GSFileHandle*) fh fileDescriptor];
int fileDescriptor = [fh fileDescriptor];
struct sockaddr_in sockAddress;
socklen_t address_len = sizeof(sockAddress);
char str[INET_ADDRSTRLEN];
@ -344,6 +346,7 @@ void _sendMessage(GSWMessage * message, NSFileHandle* fh, NSString * httpVersion
if ((([method isEqualToString:GET]) || ([method isEqualToString:HEAD])) ||
([method isEqualToString:POST] == NO || (length <1))) {
NSLog(@"%s: unsupportet method '%@'", __PRETTY_FUNCTION__, method);
return nil;
}
@ -366,8 +369,10 @@ void _sendMessage(GSWMessage * message, NSFileHandle* fh, NSString * httpVersion
uint16_t rPort = 0;
NSString * rAddress = nil;
#ifdef GNUSTEP
[(GSFileHandle*) fh setNonBlocking: NO];
#endif
// get info about who talks to us
[self _getConnectionInfoFromHandle: fh

View file

@ -41,7 +41,7 @@
GSWAssociation * _href;
GSWAssociation * _disabled;
GSWAssociation * _fragmentIdentifier;
GSWAssociation * _secure;
// GSWAssociation * _secure;
GSWAssociation * _queryDictionary;
GSWAssociation * _actionClass;
GSWAssociation * _directActionName;

View file

@ -68,7 +68,7 @@ static Class NSStringClass = Nil;
DESTROY(_href);
DESTROY(_disabled);
DESTROY(_fragmentIdentifier);
DESTROY(_secure);
// DESTROY(_secure);
DESTROY(_queryDictionary);
DESTROY(_actionClass);
DESTROY(_directActionName);
@ -164,7 +164,7 @@ static Class NSStringClass = Nil;
-(id) description
{
return [NSString stringWithFormat:@"<%s %p action: %@ actionClass: %@ directActionName: %@ href:%@ string:%@ queryDictionary: %@ otherQueryAssociations: %@ pageName: %@ fragmentIdentifier:%@ disabled:%@ secure:%@ >",
object_get_class_name(self),
object_getClassName(self),
(void*)self, _action, _actionClass, _directActionName, _href,
_string,
_queryDictionary, _otherQueryAssociations, _pageName,

View file

@ -89,7 +89,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -247,7 +247,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -134,7 +134,7 @@ RCS_ID("$Id$")
NSString* dscr=nil;
GSWLogAssertGood(self);
dscr=[NSString stringWithFormat:@"<%s %p -",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
dscr=[dscr stringByAppendingFormat:@" keyPath=%@>",
_keyPath];

View file

@ -222,7 +222,7 @@ NSString* GSWMessage_stringByEscapingHTMLString(GSWMessage* aMessage,NSString* a
if (aMessage)
{
return (*(aMessage->_selfMsgIMPs._stringByEscapingHTMLStringIMP))
(object_get_class(aMessage),stringByEscapingHTMLStringSEL,aString);
(object_getClass(aMessage),stringByEscapingHTMLStringSEL,aString);
}
else
return nil;
@ -234,7 +234,7 @@ NSString* GSWMessage_stringByEscapingHTMLAttributeValue(GSWMessage* aMessage,NSS
if (aMessage)
{
return (*(aMessage->_selfMsgIMPs._stringByEscapingHTMLAttributeValueIMP))
(object_get_class(aMessage),stringByEscapingHTMLAttributeValueSEL,aString);
(object_getClass(aMessage),stringByEscapingHTMLAttributeValueSEL,aString);
}
else
return nil;
@ -246,7 +246,7 @@ NSString* GSWMessage_stringByConvertingToHTMLEntities(GSWMessage* aMessage,NSStr
if (aMessage)
{
return (*(aMessage->_selfMsgIMPs._stringByConvertingToHTMLEntitiesIMP))
(object_get_class(aMessage),stringByConvertingToHTMLEntitiesSEL,aString);
(object_getClass(aMessage),stringByConvertingToHTMLEntitiesSEL,aString);
}
else
return nil;
@ -258,7 +258,7 @@ NSString* GSWMessage_stringByConvertingToHTML(GSWMessage* aMessage,NSString* aSt
if (aMessage)
{
return (*(aMessage->_selfMsgIMPs._stringByConvertingToHTMLIMP))
(object_get_class(aMessage),stringByConvertingToHTMLSEL,aString);
(object_getClass(aMessage),stringByConvertingToHTMLSEL,aString);
}
else
return nil;
@ -327,7 +327,7 @@ void GetGSWMessageIMPs(GSWMessageIMPs* impsPtr,GSWMessage* message)
NSCAssert(message,@"No message");
Class messageClass=object_get_class(message);
Class messageClass=object_getClass(message);
NSCAssert(contentEncodingSEL,@"No contentEncodingSEL on GetGSWMessageIMPs");

View file

@ -38,6 +38,12 @@ RCS_ID("$Id$")
#include "GSWeb.h"
#include <limits.h>
#ifndef GNUSTEP
#include <GNUstepBase/GNUstep.h>
#include <GNUstepBase/GSObjCRuntime.h>
#include <GNUstepBase/GSCategories.h>
#endif
#define DEFAULT_DICTIONARY_CAPACITY 32
// Copied from NSDate.m. We should find a better solution....
@ -1089,7 +1095,7 @@ static void GSWMapBaseInitWithZoneAndCapacity(GSWMapBase base,
NSString* descr=nil;
//TODO
descr=[NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
NSStringFromClass([self class]),
(void*)self];
return descr;
};

View file

@ -152,7 +152,7 @@ static SEL valueInComponentSEL = NULL;
-(id) description
{
return [NSString stringWithFormat:@"<%s %p list:%@ item:%@ string:%@ selections:%@ selectedValue:%@ NoSelectionString:%@ >",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_list, _item, _string, _selection, _selectedValue, _noSelectionString];
};

View file

@ -63,7 +63,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - bundlePath:[%@] relativePaths:[%@] projectName:[%@] subprojects:[%@] pbProjectDictionary:[%@]>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_bundlePath,
_relativePathsCache,

View file

@ -125,7 +125,7 @@ static Class standardClass = Nil;
-(id) description
{
return [NSString stringWithFormat:@"<%s %p checked:%@ selection:%@ disabled:%@ name:%@ value:%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_checked, _selection, _disabled, _name, _value];
};

View file

@ -175,7 +175,7 @@ static Class standardClass = Nil;
-(id) description
{
return [NSString stringWithFormat:@"<%s %p list:%@ item:%@ index:%@ selection:%@ prefix:%@ suffix:%@ displayString:%@ escapeHTML:%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_list, _item, _index,
_selection, _prefix, _suffix, _displayString, _escapeHTML];

View file

@ -176,7 +176,7 @@ RCS_ID("$Id$")
NSMutableData* contentData = nil;
int contentLength=0;
NSString* applicationURLPrefix=nil;
NSStringEncoding contentEncoding=GSUndefinedEncoding;
NSStringEncoding contentEncoding=NSUTF8StringEncoding;
LOGObjectFnStart();

View file

@ -125,7 +125,7 @@ static SEL setValueInComponentSEL = NULL;
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p list:%@ item:%@ count:%@ index:%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_list, _item, _count, _index];
};

View file

@ -158,7 +158,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat: @"<%s %p : %@: %.1f>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_value,
_quality];
@ -535,7 +535,7 @@ RCS_ID("$Id$")
int i=0;
int browserLanguagesCount=0;
browserLanguages=[browserLanguages mutableCopy];
browserLanguages=[[browserLanguages mutableCopy] autorelease];
browserLanguagesCount=[browserLanguages count];
for(i=0;i<browserLanguagesCount;i++)
@ -607,7 +607,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultFormValueEncoding=%u, formValueEncoding=%u, formValues=%@, uriElements=%@, cookie=%@, applicationURLPrefix=%@, requestHandlerPathArray=%@, browserLanguages=%@, requestType=%d, isUsingWebServer=%s, formValueEncodingDetectionEnabled=%s, applicationNumber=%d",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_method,
_uri,
@ -1519,6 +1519,8 @@ RCS_ID("$Id$")
formValues=[self _extractValuesFromFormData:formData
withEncoding:formValueEncoding];
[_formValues release];
ASSIGN(_formValues,formValues);
};
};

View file

@ -162,7 +162,7 @@ NSString* localNotFoundMarker=@"NOTFOUND";
NS_DURING
{
dscr=[NSString stringWithFormat:@"<%s %p - _frameworkProjectBundlesCache:%p _appURLs:%@ _frameworkURLs:%@ _appPaths:%@ _frameworkPaths:%@ _urlValuedElementsData:%@ _frameworkClassPaths:%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
(void*)_frameworkProjectBundlesCache,
_appURLs,

View file

@ -218,7 +218,7 @@ void GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(GSWResponse*
LOGObjectFnStart();
description=[NSString stringWithFormat:
@"<%s %p - httpVersion=%@ status=%d headers=%p contentFaults=%p contentData=%p contentEncoding=%d userInfo=%p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_httpVersion,
_status,

View file

@ -58,7 +58,7 @@ RCS_ID("$Id$")
-(id)description
{
return [NSString stringWithFormat:@"<%s: %p sessions=%@ manager=%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_sessions,
_timeOutManager];

View file

@ -293,11 +293,11 @@ extern id gcObjectsToBeVisited;
NSDebugMLLog(@"sessions",@"sessionIDCount=%u",(unsigned int)[sessionID retainCount]);
*/
// dscr=[NSString stringWithFormat:@"<%s %p>",
// object_get_class_name(self),
// object_getClassName(self),
// (void*)self];
dscr=[NSString stringWithFormat:@"<%s %p - sessionID=%@ autoreleasePool=%p timeOut=%f contextArrayStack=%@",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_sessionID,
(void*)_autoreleasePool,
@ -1364,7 +1364,7 @@ Returns first element of languages or nil if languages is empty
// We can't set the editing context if one has already been created
[NSException raise:NSInvalidArgumentException
format:@"%s Can't set a defautEditingContext when one already exists",
object_get_class_name(self)];
object_getClassName(self)];
}
else
{

View file

@ -84,7 +84,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - sessionID=%@ timeOutTime=%@ lastAccessTime=%@ timeOut=%ld isCheckedOut=%s",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_sessionID,
[self timeOutTimeDate],

View file

@ -55,9 +55,9 @@ RCS_ID("$Id$")
// selfLock=[NSRecursiveLock new];
_selfLock=[NSLock new];
_target=nil;
};
}
return self;
};
}
//--------------------------------------------------------------------
-(void)dealloc
@ -68,7 +68,7 @@ RCS_ID("$Id$")
DESTROY(_timer);
DESTROY(_selfLock);
[super dealloc];
};
}
// Must be locked
-(GSWSessionTimeOut*)_sessionTimeOutForSessionID:(NSString*)sessionID
@ -90,10 +90,10 @@ RCS_ID("$Id$")
[_sessionTimeOuts setObject:sessionTimeOut
forKey:sessionID];
[_sessionOrderedTimeOuts addObject:sessionTimeOut];
};
}
LOGObjectFnStop();
return sessionTimeOut;
};
}
// Must not be locked
-(GSWSessionTimeOut*)sessionTimeOutForSessionID:(NSString*)sessionID
@ -116,262 +116,95 @@ RCS_ID("$Id$")
[self unlock];
LOGObjectFnStop();
return sessionTimeOut;
};
}
//--------------------------------------------------------------------
-(void)updateTimeOutForSessionWithID:(NSString*)sessionID
timeOut:(NSTimeInterval)timeOut
{
//OK
BOOL selfLocked=NO;
BOOL targetLocked=NO;
LOGObjectFnStart();
[self lock];
selfLocked=YES;
NS_DURING
SYNCHRONIZED(self) {
NSTimer* timer=nil;
GSWSessionTimeOut* sessionTimeOut=nil;
sessionTimeOut=[self _sessionTimeOutForSessionID:sessionID];
NSAssert(sessionTimeOut,@"No sessionTimeOut");
[_sessionOrderedTimeOuts removeObject:sessionTimeOut];
[sessionTimeOut setLastAccessTime:
[NSDate timeIntervalSinceReferenceDate]];
if (timeOut!=[sessionTimeOut sessionTimeOutValue])
[sessionTimeOut setSessionTimeOutValue:timeOut];
[_sessionOrderedTimeOuts addObject:sessionTimeOut];
timer=[self resetTimer];
if (timer)
{
NSTimer* timer=nil;
GSWSessionTimeOut* sessionTimeOut=nil;
NSDebugMLLog(@"sessions",@"timeOut=%ld s",
(long)timeOut);
sessionTimeOut=[self _sessionTimeOutForSessionID:sessionID];
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut);
NSDebugMLLog(@"sessions",@"self=%p _sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
NSAssert(sessionTimeOut,@"No sessionTimeOut");
[_sessionOrderedTimeOuts removeObject:sessionTimeOut];
[sessionTimeOut setLastAccessTime:
[NSDate timeIntervalSinceReferenceDate]];
if (timeOut!=[sessionTimeOut sessionTimeOutValue])
[sessionTimeOut setSessionTimeOutValue:timeOut];
[_sessionOrderedTimeOuts addObject:sessionTimeOut];
NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut);
timer=[self resetTimer];
NSDebugMLLog(@"sessions",@"timer=%@",timer);
NSDebugMLLog(@"sessions",@"timer fireDate=%@",[timer fireDate]);
if (timer)
{
[_target lock];
targetLocked=YES;
NS_DURING
{
[self addTimer:timer];
}
NS_HANDLER
{
NSLog(@"### exception from ... addTimer... %@", [localException reason]);
LOGException(@"%@ (%@)",localException,[localException reason]);
NSLog(@"### exception ... %@", [localException reason]);
//TODO
if (targetLocked)
{
[_target unlock];
targetLocked=NO;
};
if (selfLocked)
{
NSDebugMLLog(@"sessions",@"Unlock self");
[self unlock];
selfLocked=NO;
};
[localException raise];
}
NS_ENDHANDLER;
if (targetLocked)
{
[_target unlock];
targetLocked=NO;
};
};
}
NS_HANDLER
{
NSLog(@"### exception ... %@", [localException reason]);
LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO
if (selfLocked)
{
NSDebugMLLog(@"sessions",@"Unlock self");
[self unlock];
selfLocked=NO;
};
[localException raise];
}
NS_ENDHANDLER;
if (selfLocked)
{
NSDebugMLLog(@"sessions",@"Unlock self");
[self unlock];
selfLocked=NO;
};
LOGObjectFnStop();
};
SYNCHRONIZED(_target) {
[self addTimer:timer];
}
END_SYNCHRONIZED;
}
}
END_SYNCHRONIZED;
}
//--------------------------------------------------------------------
-(void)handleTimer:(NSTimer*)aTimer
{
//OK
BOOL requestHandlingLocked=NO;
BOOL selfLocked=NO;
BOOL targetLocked=NO;
[GSWApp lockRequestHandling];
requestHandlingLocked=YES;
NS_DURING
SYNCHRONIZED(GSWApp) {
GSWSessionTimeOut* sessionTimeOut=nil;
NSTimeInterval now=[NSDate timeIntervalSinceReferenceDate];
NSTimer* timer=nil;
int removedNb=0;
NSUInteger timeOutCount = [_sessionOrderedTimeOuts count];
NSUInteger index;
index = timeOutCount-1;
while ((index > 1) && ((sessionTimeOut = [_sessionOrderedTimeOuts objectAtIndex:index-1])))
{
[self lock];
selfLocked=YES;
NS_DURING
{
NSEnumerator *sessionTimeOutEnum = nil;
GSWSessionTimeOut* sessionTimeOut=nil;
NSTimeInterval now=[NSDate timeIntervalSinceReferenceDate];
NSTimer* timer=nil;
int removedNb=0;
/*
if ([sessionOrderedTimeOuts count]>0)
_sessionTimeOut=[sessionOrderedTimeOuts objectAtIndex:0];
*/
sessionTimeOutEnum = [_sessionOrderedTimeOuts objectEnumerator];
while (/*_removedNb<20 && *//*sessionTimeOut && [sessionTimeOut timeOutTime]<_now*/
(sessionTimeOut = [sessionTimeOutEnum nextObject]))
{
if ([sessionTimeOut timeOutTime]<now)
{
id session=nil;
[_target lock];
targetLocked=YES;
NS_DURING
{
NSDebugMLLog(@"sessions",@"[sessionTimeOut sessionID]=%@",[sessionTimeOut sessionID]);
NSDebugMLLog(@"sessions",@"target [%@]=%@",[_target class],_target);
NSDebugMLLog(@"sessions",@"_callback=%@",NSStringFromSelector(_callback));
session=[_target performSelector:_callback
withObject:[sessionTimeOut sessionID]];
NSDebugMLLog(@"sessions",@"session=%@",session);
}
NS_HANDLER
{
NSLog(@"### exception ... %@", [localException reason]);
LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO
[_target unlock];
targetLocked=NO;
timer=[self resetTimer];
NSDebugMLLog(@"sessions",@"timer=%@",timer);
NSDebugMLLog(@"sessions",@"timer fireDate=%@",[timer fireDate]);
if (timer)
[self addTimer:timer];
[self unlock];
selfLocked=NO;
[GSWApp unlockRequestHandling];
requestHandlingLocked=NO;
[localException raise];
}
NS_ENDHANDLER;
[_target unlock];
targetLocked=NO;
NSDebugMLLog(@"sessions",@"session=%p",session);
if (sessionTimeOut)
{
// Remove sessionTimeOut anyway
[_sessionTimeOuts removeObjectForKey:[sessionTimeOut sessionID]];
//NSLog(@"%d %d removed from _sessionTimeOuts",__FILE__,__LINE__);
[_sessionOrderedTimeOuts removeObject:sessionTimeOut];
//NSLog(@"%s %d removed from _sessionOrderedTimeOuts",__FILE__,__LINE__);
};
NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
removedNb++;
if (session)
{
NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
[session _terminateByTimeout];
NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
/*
if ([sessionOrderedTimeOuts count]>0)
_sessionTimeOut=[sessionOrderedTimeOuts objectAtIndex:0];
else
_sessionTimeOut=nil;
*/
}
else
sessionTimeOut=nil;
};
};
timer=[self resetTimer];
NSDebugMLLog(@"sessions",@"timer=%@",timer);
NSDebugMLLog(@"sessions",@"timer fireDate=%@",[timer fireDate]);
if (timer)
[self addTimer:timer];
if ([sessionTimeOut timeOutTime]<now)
{
id session=nil;
SYNCHRONIZED(_target) {
session=[_target performSelector:_callback
withObject:[sessionTimeOut sessionID]];
}
NS_HANDLER
END_SYNCHRONIZED;
if (sessionTimeOut)
{
LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO
if (selfLocked)
{
[self unlock];
selfLocked=NO;
};
if (requestHandlingLocked)
{
[GSWApp unlockRequestHandling];
requestHandlingLocked=NO;
};
[localException raise];
};
NS_ENDHANDLER;
NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
if (selfLocked)
[_sessionTimeOuts removeObjectForKey:[sessionTimeOut sessionID]];
[_sessionOrderedTimeOuts removeObject:sessionTimeOut];
}
removedNb++;
if (session)
{
[self unlock];
selfLocked=NO;
};
}
NS_HANDLER
{
LOGException(@"%@ (%@)",localException,[localException reason]);
//TODO
if (requestHandlingLocked)
{
[GSWApp unlockRequestHandling];
requestHandlingLocked=NO;
};
[localException raise];
};
NS_ENDHANDLER;
if (requestHandlingLocked)
{
[GSWApp unlockRequestHandling];
requestHandlingLocked=NO;
};
};
[session _terminateByTimeout];
}
else
sessionTimeOut=nil;
}
index--;
} // while
timer=[self resetTimer];
if (timer)
[self addTimer:timer];
}
END_SYNCHRONIZED; // GSWApp
}
//--------------------------------------------------------------------
-(NSTimer*)resetTimer
@ -455,7 +288,7 @@ RCS_ID("$Id$")
ASSIGN(_timer,newTimer);
NSDebugMLLog(@"sessions",@"old timer=%@",_timer);
NSDebugMLLog(@"sessions",@"new timer=%@",newTimer);
};
}
}
else
ASSIGN(_timer,newTimer);
@ -474,7 +307,7 @@ RCS_ID("$Id$")
NSDebugMLLog(@"sessions",@"newTimer fireDate=%@",[newTimer fireDate]);
LOGObjectFnStop();
return newTimer;
};
}
//--------------------------------------------------------------------
-(void)addTimer:(NSTimer*)timer
@ -487,7 +320,7 @@ RCS_ID("$Id$")
{
_target=nil;
_callback=NULL;
};
}
//--------------------------------------------------------------------
-(void)setCallBack:(SEL)callback
@ -500,7 +333,7 @@ RCS_ID("$Id$")
_target=target; //Do not retain !
_callback=callback;
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
-(BOOL)tryLockBeforeTimeIntervalSinceNow:(NSTimeInterval)ti
@ -518,7 +351,7 @@ RCS_ID("$Id$")
NSDebugMLLog(@"sessions",@"selfLockn=%d",_selfLockn);
LOGObjectFnStop();
return locked;
};
}
//--------------------------------------------------------------------
-(void)lockBeforeTimeIntervalSinceNow:(NSTimeInterval)ti
@ -532,7 +365,7 @@ RCS_ID("$Id$")
#endif
NSDebugMLLog(@"sessions",@"selfLockn=%d",_selfLockn);
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
-(void)lock
@ -540,7 +373,7 @@ RCS_ID("$Id$")
LOGObjectFnStart();
[self lockBeforeTimeIntervalSinceNow:GSLOCK_DELAY_S];
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
-(void)unlock
@ -553,7 +386,7 @@ RCS_ID("$Id$")
#endif
NSDebugMLLog(@"sessions",@"selfLockn=%d",_selfLockn);
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
@ -713,7 +546,7 @@ RCS_ID("$Id$")
[self unlock];
//[GSWApp unlockRequestHandling];
[localException raise];
};
}
NS_ENDHANDLER;
NSDebugMLLog(@"sessions",@"self=%p sessionOrderedTimeOuts %p=%@",
self,_sessionOrderedTimeOuts,_sessionOrderedTimeOuts);
@ -738,17 +571,17 @@ RCS_ID("$Id$")
NSDebugMLLog(@"sessions",@"newTimer fireDate=%@",[newTimer fireDate]);
NSDebugMLLog(@"sessions",@"newTimer tisn=%f",[[newTimer fireDate]timeIntervalSinceNow]);
NSDebugMLLog(@"sessions",@"selfLockn=%d",_selfLockn);
};
}
//[GSWApp unlockRequestHandling];
//[GSWApplication statusLogString:@"-Stop HandleTimerRefusingSessions"];
//NSLog(@"-Stop HandleTimerRefusingSessions");
};
}
- (NSString*) description
{
NSString * desStr = [NSString stringWithFormat:@"<%s %p sessionOrderedTimeOuts:%@ sessionTimeOuts:%@ target:XX callback:%@ timer:%@ selfLock:%@>", object_get_class_name(self),
NSString * desStr = [NSString stringWithFormat:@"<%s %p sessionOrderedTimeOuts:%@ sessionTimeOuts:%@ target:XX callback:%@ timer:%@ selfLock:%@>", object_getClassName(self),
(void*)self,
_sessionOrderedTimeOuts,
_sessionTimeOuts,

View file

@ -112,7 +112,7 @@ static Class standardClass = Nil;
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - value=%@ dateFormat=%@ numberFormat=%@ escapeHTML=%@ formatter=%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_value,
_dateFormat,

View file

@ -92,7 +92,7 @@ RCS_ID("$Id$")
-(id) description
{
return [NSString stringWithFormat:@"<%s %p action: %@ actionClass: %@ directActionName:%@ disabled:%@ >",
object_get_class_name(self),
object_getClassName(self),
(void*)self, _action, _actionClass, _directActionName,
_disabled];
};

View file

@ -98,7 +98,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -90,7 +90,7 @@ RCS_ID("$Id$")
withParserType: [self defaultTemplateParserType]
parserClassName: nil
withString: HTMLString
encoding: GSUndefinedEncoding
encoding: NSUTF8StringEncoding
fromPath: nil
declarationsString: declarationsString
languages: languages

View file

@ -90,7 +90,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p: properties=%@ parent=%p children count=%d templateInfo=%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_properties,
_parent,

View file

@ -65,7 +65,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -116,7 +116,7 @@ static Class standardClass = Nil;
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -101,7 +101,7 @@ RCS_ID("$Id$")
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - responsePage Name=%@ contextID=%@ senderID=%@>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
[_responsePage name],
_contextID,

View file

@ -240,7 +240,7 @@ static Class NSStringClass = Nil;
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
object_getClassName(self),
(void*)self];
};

View file

@ -89,7 +89,10 @@ GSWEB_EXPORT NSNumber* GSWIntNumber(int value);
typedef long long GSWTime; // usec since Epoch
#ifndef USEC_PER_SEC
#define USEC_PER_SEC ((GSWTime)1000000)
#endif
#define GSWTime_makeTimeFromSecAndUSec(sec,usec) ((GSWTime)(sec)*USEC_PER_SEC+(GSWTime)(usec))
GSWEB_EXPORT GSWTime GSWTime_now();

View file

@ -1476,7 +1476,7 @@ NSString* GSWGetDefaultDocRoot()
-(NSString*)description
{
return (*nsString_stringWithFormatIMP)(nsStringClass,stringWithFormatSEL,@"<%s %p - searchList:\n%@\n persDomains:\n%@\n tempDomains:\n%@\n changedDomains:\n%@\n dictionaryRep:\n%@\n defaultsDatabase:\n%@\n>",
object_get_class_name(self),
object_getClassName(self),
(void*)self,
_searchList,
_persDomains,
@ -2091,7 +2091,7 @@ NSString* GSWGetDefaultDocRoot()
//--------------------------------------------------------------------
+ (NSStringEncoding) encodingNamed:(NSString*) encodingName
{
NSStringEncoding encoding=GSUndefinedEncoding;
NSStringEncoding encoding=NSUnicodeStringEncoding;
NSCAssert(encodingsByName,@"encodingsByName not initialized");

View file

@ -22,8 +22,14 @@
Boston, MA 02111 USA.
*/
#ifndef GNUSTEP
#include <GNUstepBase/GNUstep.h>
#include <GNUstepBase/NSDebug+GNUstepBase.h>
#endif
#include <Foundation/Foundation.h>
#include <Foundation/NSThread.h>
#include <sys/socket.h>
#include "GSWWOCompatibility.h"
@ -212,7 +218,7 @@ static NSString *REQUEST_ID = @"x-webobjects-request-id";
- (NSString*) description
{
return [NSString stringWithFormat:@"<%s %p socket:%@ >",
object_get_class_name(self),
object_getClassName(self),
(void*)self, _serverSocket];
}

View file

@ -43,6 +43,7 @@
#ifndef GNUSTEP
#include <GNUstepBase/GNUstep.h>
#include <GNUstepBase/NSDebug+GNUstepBase.h>
#endif
#if GDL2
@ -77,7 +78,7 @@
#include <Foundation/NSThread.h>
#include <Foundation/NSFormatter.h>
#include <GNUstepBase/GSXML.h>
#include <GNUstepBase/GSCategories.h>
//#include <GNUstepBase/GSCategories.h>
#include "GSWConfig.h"
@class EOEditingContext;

View file

@ -34,6 +34,11 @@ RCS_ID("$Id$")
#include "GSWeb.h"
#ifndef GNUSTEP
#include <GNUstepBase/GSObjCRuntime.h>
#endif
#include <limits.h>
/*
@ -351,7 +356,7 @@ void allocOrReallocUnicharString(unichar** ptrPtr,int* capacityPtr,int length,in
NSString* baseStringByConvertingToHTML(NSString* string,GSWHTMLConvertingStruct* convStructPtr,BOOL includeCRLF)
{
NSString* str=nil;
int length=[string length];
NSUInteger length=[string length];
NSCAssert(convStructPtr->charsCount>0,@"normalChars not initialized");
if (length>0)
{
@ -526,7 +531,8 @@ NSString* baseStringByConvertingFromHTML(NSString* string,GSWHTMLConvertingStruc
int srcLen=0;
int dstLen=0;
unichar dstUnichar;
unichar* pString=GSAutoreleasedBuffer((length+1)*sizeof(unichar));
// unichar* pString=GSAutoreleasedBuffer((length+1)*sizeof(unichar));
unichar* pString=malloc((length+1)*sizeof(unichar));
int i=0;
int j=0;
[string getCharacters:pString];
@ -577,11 +583,14 @@ NSString* baseStringByConvertingFromHTML(NSString* string,GSWHTMLConvertingStruc
str=(*stringClass_stringWithStringIMP)(stringClass,stringWithStringSEL,string);
else
str=string;
free(pString);
}
else if ([string isKindOfClass:mutableStringClass])
str=@"";
else
str=AUTORELEASE(RETAIN(string));
return str;
};
@ -604,11 +613,11 @@ NSString* baseStringByConvertingFromHTML(NSString* string,GSWHTMLConvertingStruc
//
-(NSString*) decodeURLEncoding:(NSStringEncoding) encoding
{
unsigned orglen = [self length];
NSUInteger orglen = [self length];
NSMutableData *new = [NSMutableData dataWithLength: orglen];
const unsigned char *read;
unsigned char *write;
unsigned i,n,l;
NSUInteger i,n,l;
read = [self UTF8String];
write = [new mutableBytes];

View file

@ -5,11 +5,6 @@ DYNAMIC_LINKER=simple
#GDL2=@GDL2@
AUX_LIBS=@AUX_LIBS@
#EOControl dependancy
#ifeq ($(GDL2),yes)
#EOCONTROL_LIBRARY_NAME=EOControl
#EOACCESS_LIBRARY_NAME=EOAccess
#endif
#Native Framework support
ifeq ($(OBJC_RUNTIME_LIB),apple)
@ -37,6 +32,9 @@ GSWDEBUG_DEEP=no
#Debug elmentIDs logs and asserts
GSWDEBUG_ELEMENTSIDS=no
# use WO Names. Others are depricated. -- dw
gswnames=wo
# Default (generated by configure)
ifeq ($(gswnames),)
gswnames=@GSWNAMES@

View file

@ -31,17 +31,17 @@ GSWEB_SUBMINOR_VERSION = @SUBMINOR_VERSION@
ifeq ($(GSW_NAMES),wo)
AUXILIARY_GSW_LIBS += -lWebObjects -lWOExtensions -lWOExtensionsGSW
else
AUXILIARY_GSW_LIBS += -lGSWeb -lGSWExtensions -lGSWExtensionsGSW
# AUXILIARY_GSW_LIBS += -lGSWeb -lGSWExtensions -lGSWExtensionsGSW
endif
AUXILIARY_INCLUDE_DIRS += @AUX_INCS@
AUXILIARY_TOOL_LIBS += @AUX_LIBS@
GDL2=@GDL2@
ifeq ($(GDL2),yes)
include $(GNUSTEP_MAKEFILES)/Auxiliary/gdl2.make
endif
#GDL2=@GDL2@
#ifeq ($(GDL2),yes)
#include $(GNUSTEP_MAKEFILES)/Auxiliary/gdl2.make
#endif
endif # GSWEB_MAKE_LOADED