MacOS-X compatibility fixup

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24799 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-03-07 13:16:00 +00:00
parent af2aca2fcf
commit 8d4cc1374c
2 changed files with 19 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2007-03-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSHTTPURLHandle.m: Mimic MacOS-X behavior and cancel loading
if http status code is not in the 200-299 (success) range.
2007-03-07 Richard Frith-Macdonald <rfm@gnu.org>
* Tools/objctidy.m: Removed ... should not have been added really as

View file

@ -617,6 +617,7 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
GSMimeHeader *info;
NSString *val;
float ver;
int code;
connectionState = idle;
[nc removeObserver: self name: nil object: sock];
@ -635,7 +636,8 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
*/
info = [document headerNamed: @"http"];
val = [info objectForKey: NSHTTPPropertyStatusCodeKey];
if ([val intValue] == 401 && self->challenged < 2)
code = [val intValue];
if (code == 401 && self->challenged < 2)
{
GSMimeHeader *ah;
@ -734,8 +736,17 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
bodyPos = 0;
DESTROY(wData);
NSResetMapTable(wProperties);
[self didLoadBytes: [d subdataWithRange: r]
loadComplete: YES];
if (code >= 200 && code < 300)
{
[self didLoadBytes: [d subdataWithRange: r]
loadComplete: YES];
}
else
{
[self didLoadBytes: [d subdataWithRange: r]
loadComplete: NO];
[self cancelLoadInBackground];
}
}
else
{