fix for handling stream connection failures

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23213 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-08-07 20:01:00 +00:00
parent 4ee3178adf
commit aa1ecf7e6e
3 changed files with 22 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2006-08-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/win32/NSStreamWin32.m:
* Source/unix/NSStream.m:
If a connection attampt fails, propogate error to sibling stream so
both streams in the pair get a failure.
2006-08-07 00:13-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSData.m: Correct issue in initWithCoder: and encodeWithCoder:

View file

@ -524,6 +524,8 @@ static void setNonblocking(int fd)
errno = error;
[self _recordError];
myEvent = NSStreamEventErrorOccurred;
[_sibling _recordError];
[_sibling _sendEvent: myEvent];
}
}
else
@ -882,6 +884,8 @@ static void setNonblocking(int fd)
errno = error;
[self _recordError];
myEvent = NSStreamEventErrorOccurred;
[_sibling _recordError];
[_sibling _sendEvent: myEvent];
}
}
else
@ -1330,7 +1334,7 @@ static void setNonblocking(int fd)
return 0;
}
#define SOCKET_BACKLOG 5
#define SOCKET_BACKLOG 256
- (void) open
{

View file

@ -794,6 +794,11 @@ static void setNonblocking(SOCKET fd)
if (error)
errno = error;
[self _recordError];
if (_sibling)
{
[_sibling _recordError];
[_sibling _sendEvent: NSStreamEventOpenCompleted];
}
}
}
else
@ -1350,6 +1355,11 @@ static void setNonblocking(SOCKET fd)
if (error)
errno = error;
[self _recordError];
if (_sibling)
{
[_sibling _recordError];
[_sibling _sendEvent: NSStreamEventOpenCompleted];
}
}
}
else