From 0771f6b448c6eb1433b78a33f039d03d36ab5866 Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Thu, 8 Nov 2001 21:41:05 +0000 Subject: [PATCH] Improve tunnelling error handling git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11346 72102866-910b-0410-8b05-ffd578937521 --- Source/GSHTTPURLHandle.m | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index adc5e14e3..66403395d 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -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];