mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-11 00:30:49 +00:00
Fix for malloc of non-freeable zones
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19449 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
58c0a26e27
commit
a23a6bcf33
3 changed files with 53 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-06-03 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSZone.m: Fixed error in malloc of non-freeable zones
|
||||||
|
(bug #9199) was failing to update top of block after allocation.
|
||||||
|
|
||||||
2004-06-02 Richard Frith-Macdonald <rfm@gnu.org>
|
2004-06-02 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSUnarchiver.m: Decode class names directly so we can
|
* Source/NSUnarchiver.m: Decode class names directly so we can
|
||||||
|
|
|
@ -1306,7 +1306,7 @@ nmalloc (NSZone *zone, size_t size)
|
||||||
if (freesize >= chunksize)
|
if (freesize >= chunksize)
|
||||||
{
|
{
|
||||||
chunkhead = (void*)(block)+top;
|
chunkhead = (void*)(block)+top;
|
||||||
block += chunksize;
|
block->top += chunksize;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include <Foundation/Foundation.h>
|
#include <Foundation/Foundation.h>
|
||||||
#include <GNUstepBase/GCObject.h>
|
#include <GNUstepBase/GCObject.h>
|
||||||
|
#include <GNUstepBase/GSMime.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,6 +31,52 @@ static void test2(void)
|
||||||
NSLog(@"-[NSURL path] returned \"%@\", expected \"%@\"", result, expected);
|
NSLog(@"-[NSURL path] returned \"%@\", expected \"%@\"", result, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static try(GSMimeParser *p, NSData *d)
|
||||||
|
{
|
||||||
|
if ([p parse: d] == NO)
|
||||||
|
{
|
||||||
|
NSLog(@"HTTP parse failure - %@", p);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BOOL complete = [p isComplete];
|
||||||
|
GSMimeDocument *document = [p mimeDocument];
|
||||||
|
|
||||||
|
if (complete == NO && [p isInHeaders] == NO)
|
||||||
|
{
|
||||||
|
NSString *enc;
|
||||||
|
NSString *len;
|
||||||
|
int ver;
|
||||||
|
|
||||||
|
ver = [[[document headerNamed: @"http"]
|
||||||
|
objectForKey: NSHTTPPropertyServerHTTPVersionKey] intValue];
|
||||||
|
len = [[document headerNamed: @"content-length"] value];
|
||||||
|
enc = [[document headerNamed: @"content-transfer-encoding"] value];
|
||||||
|
if (enc == nil)
|
||||||
|
{
|
||||||
|
enc = [[document headerNamed: @"transfer-encoding"] value];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ([enc isEqualToString: @"chunked"] == YES)
|
||||||
|
{
|
||||||
|
complete = NO; // Read chunked body data
|
||||||
|
}
|
||||||
|
else if (ver >= 1 && [len intValue] == 0)
|
||||||
|
{
|
||||||
|
complete = YES; // No content
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
complete = NO; // No
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (complete == YES)
|
||||||
|
{
|
||||||
|
NSLog(@"Got data %@", [p data]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
id pool = [NSAutoreleasePool new];
|
id pool = [NSAutoreleasePool new];
|
||||||
|
|
Loading…
Reference in a new issue