mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +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
f77a900564
commit
7462e0e625
1 changed files with 15 additions and 1 deletions
|
@ -1204,10 +1204,24 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
||||||
*/
|
*/
|
||||||
if (sock != nil)
|
if (sock != nil)
|
||||||
{
|
{
|
||||||
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
NSRunLoop *loop = [NSRunLoop currentRunLoop];
|
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
|
[loop acceptInputForMode: NSDefaultRunLoopMode
|
||||||
beforeDate: nil];
|
beforeDate: nil];
|
||||||
|
[nc removeObserver: self
|
||||||
|
name: NSFileHandleReadCompletionNotification
|
||||||
|
object: test];
|
||||||
|
RELEASE(test);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sock == nil)
|
if (sock == nil)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue