mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-22 19:21:23 +00:00
GSWApplication.*:
* use [[NSThread currentThread] threadDictionary] GSWMultiKeyDictionary.m * fix format GSWRequest.m * fix potential double release GSWComponentRequestHandler.* * add comments for rejectFavicon GSWSessionTimeOutManager.m * fix index NSString+HTML.m, GSWBaseParser.m, GSWDeclarationParser.m, GSWHTMLRawParser.m * use NSZoneMalloc() git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@30216 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
950b719bf5
commit
629389a62b
13 changed files with 43 additions and 36 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2010-04-16 David Wetzel <dave@turbocat.de>
|
||||
GSWApplication.*:
|
||||
* use [[NSThread currentThread] threadDictionary]
|
||||
GSWMultiKeyDictionary.m
|
||||
* fix format
|
||||
GSWRequest.m
|
||||
* fix potential double release
|
||||
GSWComponentRequestHandler.*
|
||||
* add comments for rejectFavicon
|
||||
GSWSessionTimeOutManager.m
|
||||
* fix index
|
||||
NSString+HTML.m, GSWBaseParser.m, GSWDeclarationParser.m, GSWHTMLRawParser.m
|
||||
* use NSZoneMalloc()
|
||||
|
||||
2010-04-16 David Wetzel <dave@turbocat.de>
|
||||
* fixed memory leak
|
||||
* ported to OS X (beta)
|
||||
|
|
|
@ -91,7 +91,6 @@ GSWEB_EXPORT BOOL WOStrictFlag;
|
|||
NSMutableDictionary* _requestHandlers;
|
||||
GSWRequestHandler* _defaultRequestHandler;
|
||||
NSString* _hostAddress;
|
||||
NSMutableDictionary* _contextDictionary;
|
||||
@public //TODO-NOW REMOVE
|
||||
NSRecursiveLock* _selfLock;
|
||||
#ifndef NDEBUG
|
||||
|
|
|
@ -298,7 +298,6 @@ int GSWApplicationMain(NSString* applicationClassName,
|
|||
|
||||
[[self class] _setApplication:self];
|
||||
[self _touchPrincipalClasses];
|
||||
_contextDictionary = [NSMutableDictionary new];
|
||||
|
||||
standardUserDefaults=[NSUserDefaults standardUserDefaults];
|
||||
NSDebugMLLog(@"options",@"standardUserDefaults=%@",standardUserDefaults);
|
||||
|
@ -412,7 +411,6 @@ int GSWApplicationMain(NSString* applicationClassName,
|
|||
DESTROY(_initialTimer);
|
||||
DESTROY(_activeSessionsCountLock);
|
||||
DESTROY(_lifebeatThread);
|
||||
DESTROY(_contextDictionary);
|
||||
|
||||
if (GSWApp == self)
|
||||
{
|
||||
|
@ -1470,15 +1468,14 @@ int GSWApplicationMain(NSString* applicationClassName,
|
|||
//--------------------------------------------------------------------
|
||||
-(void)_setContext:(GSWContext*)aContext
|
||||
{
|
||||
SYNCHRONIZED(self) {
|
||||
NSMutableDictionary * thDict = [[NSThread currentThread] threadDictionary];
|
||||
|
||||
if (aContext) {
|
||||
[_contextDictionary setObject:aContext
|
||||
[thDict setObject:aContext
|
||||
forKey:GSWThreadKey_Context];
|
||||
} else {
|
||||
[_contextDictionary removeObjectForKey:GSWThreadKey_Context];
|
||||
[thDict removeObjectForKey:GSWThreadKey_Context];
|
||||
}
|
||||
}
|
||||
END_SYNCHRONIZED;
|
||||
|
||||
}
|
||||
|
||||
|
@ -1488,10 +1485,9 @@ int GSWApplicationMain(NSString* applicationClassName,
|
|||
{
|
||||
GSWContext* context=nil;
|
||||
|
||||
SYNCHRONIZED(self) {
|
||||
context=[_contextDictionary objectForKey:GSWThreadKey_Context];
|
||||
}
|
||||
END_SYNCHRONIZED;
|
||||
NSMutableDictionary * thDict = [[NSThread currentThread] threadDictionary];
|
||||
|
||||
context = [thDict objectForKey:GSWThreadKey_Context];
|
||||
|
||||
return context;
|
||||
}
|
||||
|
|
|
@ -55,8 +55,7 @@ RCS_ID("$Id$")
|
|||
DESTROY(_string);
|
||||
if (_uniBuf)
|
||||
{
|
||||
//objc_free(_uniBuf);
|
||||
free(_uniBuf);
|
||||
NSZoneFree(NSDefaultMallocZone(),_uniBuf);
|
||||
_uniBuf=NULL;
|
||||
};
|
||||
[super dealloc];
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
/*
|
||||
returns YES. Subclassers might override this.
|
||||
Used to reject requests to /favicon.ico in direct connect mode.
|
||||
*/
|
||||
- (BOOL) rejectFavicon;
|
||||
|
||||
|
|
|
@ -289,6 +289,11 @@ GSWResponse * _dispatchWithPreparedApplication(GSWApplication *app, GSWContext *
|
|||
return response;
|
||||
}
|
||||
|
||||
/*
|
||||
returns YES. Subclassers might override this.
|
||||
Used to reject requests to /favicon.ico in direct connect mode.
|
||||
*/
|
||||
|
||||
- (BOOL) rejectFavicon
|
||||
{
|
||||
return YES;
|
||||
|
|
|
@ -454,10 +454,8 @@ 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*)NSZoneMalloc(NSDefaultMallocZone(),sizeof(unichar)*(_length+1));
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
|
@ -501,8 +499,7 @@ inline GSWDeclaration* parseDeclaration(GSWDeclarationParser* parser)
|
|||
{
|
||||
if (_uniBuf)
|
||||
{
|
||||
//objc_free(_uniBuf);
|
||||
free(_uniBuf);
|
||||
NSZoneFree(NSDefaultMallocZone(),_uniBuf);
|
||||
_uniBuf=NULL;
|
||||
};
|
||||
[localException raise];
|
||||
|
|
|
@ -497,7 +497,7 @@ May raise exception.
|
|||
// 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*)NSZoneMalloc(NSDefaultMallocZone(),(sizeof(unichar)*(_length+1));
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
|
@ -637,8 +637,7 @@ May raise exception.
|
|||
{
|
||||
if (_uniBuf)
|
||||
{
|
||||
//objc_free(_uniBuf);
|
||||
free(_uniBuf);
|
||||
NSZoneFree(NSDefaultMallocZone(),_uniBuf);
|
||||
_uniBuf=NULL;
|
||||
};
|
||||
[localException raise];
|
||||
|
|
|
@ -1094,7 +1094,7 @@ static void GSWMapBaseInitWithZoneAndCapacity(GSWMapBase base,
|
|||
{
|
||||
NSString* descr=nil;
|
||||
//TODO
|
||||
descr=[NSString stringWithFormat:@"<%s %p>",
|
||||
descr=[NSString stringWithFormat:@"<%s %@>",
|
||||
NSStringFromClass([self class]),
|
||||
(void*)self];
|
||||
return descr;
|
||||
|
|
|
@ -1520,7 +1520,6 @@ RCS_ID("$Id$")
|
|||
formValues=[self _extractValuesFromFormData:formData
|
||||
withEncoding:formValueEncoding];
|
||||
|
||||
[_formValues release];
|
||||
ASSIGN(_formValues,formValues);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -163,12 +163,9 @@ RCS_ID("$Id$")
|
|||
NSTimer* timer=nil;
|
||||
int removedNb=0;
|
||||
|
||||
NSUInteger timeOutCount = [_sessionOrderedTimeOuts count];
|
||||
NSUInteger index;
|
||||
NSUInteger index = [_sessionOrderedTimeOuts count];
|
||||
|
||||
index = timeOutCount-1;
|
||||
|
||||
while ((index > 1) && ((sessionTimeOut = [_sessionOrderedTimeOuts objectAtIndex:index-1])))
|
||||
while ((index > 0) && ((sessionTimeOut = [_sessionOrderedTimeOuts objectAtIndex:index-1])))
|
||||
{
|
||||
if ([sessionTimeOut timeOutTime]<now)
|
||||
{
|
||||
|
|
|
@ -2091,7 +2091,7 @@ NSString* GSWGetDefaultDocRoot()
|
|||
//--------------------------------------------------------------------
|
||||
+ (NSStringEncoding) encodingNamed:(NSString*) encodingName
|
||||
{
|
||||
NSStringEncoding encoding=NSUnicodeStringEncoding;
|
||||
NSStringEncoding encoding;
|
||||
|
||||
NSCAssert(encodingsByName,@"encodingsByName not initialized");
|
||||
|
||||
|
|
|
@ -532,7 +532,7 @@ NSString* baseStringByConvertingFromHTML(NSString* string,GSWHTMLConvertingStruc
|
|||
int dstLen=0;
|
||||
unichar dstUnichar;
|
||||
// unichar* pString=GSAutoreleasedBuffer((length+1)*sizeof(unichar));
|
||||
unichar* pString=malloc((length+1)*sizeof(unichar));
|
||||
unichar* pString=NSZoneMalloc(NSDefaultMallocZone(),(length+1)*sizeof(unichar));
|
||||
int i=0;
|
||||
int j=0;
|
||||
[string getCharacters:pString];
|
||||
|
@ -583,7 +583,8 @@ NSString* baseStringByConvertingFromHTML(NSString* string,GSWHTMLConvertingStruc
|
|||
str=(*stringClass_stringWithStringIMP)(stringClass,stringWithStringSEL,string);
|
||||
else
|
||||
str=string;
|
||||
free(pString);
|
||||
NSZoneFree(NSDefaultMallocZone(), pString);
|
||||
|
||||
}
|
||||
else if ([string isKindOfClass:mutableStringClass])
|
||||
str=@"";
|
||||
|
|
Loading…
Reference in a new issue