Improve tunnelling error handling

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11346 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-11-08 21:41:05 +00:00
parent 20d333dfb3
commit 0771f6b448

View file

@ -210,11 +210,13 @@ static NSLock *urlLock = nil;
[dat appendData: d];
}
[p parse: dat];
if ([p isInBody] == YES)
if ([p isInBody] == YES || [d length] == 0)
{
NSDictionary *info = [[p document] headerNamed: @"http"];
NSDictionary *info;
NSString *val;
[p parse: nil];
info = [[p document] headerNamed: @"http"];
val = [info objectForKey: NSHTTPPropertyServerHTTPVersionKey];
if (val != nil)
[pageInfo setObject: val forKey: NSHTTPPropertyServerHTTPVersionKey];
@ -230,13 +232,6 @@ static NSLock *urlLock = nil;
[dat setLength: 0];
tunnel = NO;
}
else if ([d length] == 0)
{
[nc removeObserver: self
name: NSFileHandleReadCompletionNotification
object: sock];
tunnel = NO;
}
else
{
[sock readInBackgroundAndNotify];