tidied shutdown of sockets

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24475 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-02-05 13:51:39 +00:00
parent 1412d0a1ab
commit 3475a3569d
2 changed files with 4 additions and 3 deletions

View file

@ -554,9 +554,7 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
NSStringFromSelector(_cmd), keepalive?"K":"",
[d length], [d length], [d bytes]);
}
[nc removeObserver: self
name: NSFileHandleReadCompletionNotification
object: sock];
[nc removeObserver: self name: nil object: sock];
[sock closeFile];
DESTROY(sock);
}
@ -615,6 +613,7 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
val = [[document headerNamed: @"connection"] value];
if (ver < 1.1 || (val != nil && [val isEqual: @"close"] == YES))
{
[nc removeObserver: self name: nil object: sock];
[sock closeFile];
DESTROY(sock);
}