iTry to detect closed sockets earlier.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24084 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-11-13 20:38:51 +00:00
parent f8291f571d
commit ac64c81310
2 changed files with 13 additions and 0 deletions

View file

@ -1199,6 +1199,17 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
port = @"80";
}
/* An existing socket with keepalive may have been closed by the other
* end ... run the loop once (immediately returning) to try to detect it.
*/
if (sock != nil)
{
NSRunLoop *loop = [NSRunLoop currentRunLoop];
[loop acceptInputForMode: NSDefaultRunLoopMode
beforeDate: nil];
}
if (sock == nil)
{
keepalive = NO; // New connection