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:
Richard Frith-MacDonald 2007-02-05 13:51:39 +00:00
parent d25c1b0011
commit a59a1178c4
2 changed files with 4 additions and 3 deletions

View file

@ -3,6 +3,8 @@
* configure.ac: minor tweak to avoid possible inconsistency in * configure.ac: minor tweak to avoid possible inconsistency in
environment used to check LLOGN_MAX and LONG_LONG_MAX presence. environment used to check LLOGN_MAX and LONG_LONG_MAX presence.
* configure: regenerate * configure: regenerate
* Source/GSHTTPURLHandle.m: always remove self as observer for all
notifications on a socket when closing it.
2007-02-04 Richard Frith-Macdonald <rfm@gnu.org> 2007-02-04 Richard Frith-Macdonald <rfm@gnu.org>

View file

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