mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
improve test for eof on socket
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24085 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ac64c81310
commit
52894efa44
1 changed files with 15 additions and 1 deletions
|
@ -1204,10 +1204,24 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
*/
|
||||
if (sock != nil)
|
||||
{
|
||||
NSRunLoop *loop = [NSRunLoop currentRunLoop];
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
NSRunLoop *loop = [NSRunLoop currentRunLoop];
|
||||
NSFileHandle *test = RETAIN(sock);
|
||||
|
||||
[nc addObserver: self
|
||||
selector: @selector(bgdTunnelRead:)
|
||||
name: NSFileHandleReadCompletionNotification
|
||||
object: test];
|
||||
if ([test readInProgress] == NO)
|
||||
{
|
||||
[test readInBackgroundAndNotify];
|
||||
}
|
||||
[loop acceptInputForMode: NSDefaultRunLoopMode
|
||||
beforeDate: nil];
|
||||
[nc removeObserver: self
|
||||
name: NSFileHandleReadCompletionNotification
|
||||
object: test];
|
||||
RELEASE(test);
|
||||
}
|
||||
|
||||
if (sock == nil)
|
||||
|
|
Loading…
Reference in a new issue