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];