An error in a socketpair only applies to the other socket if still opening

This commit is contained in:
Richard Frith-Macdonald 2020-12-06 09:38:17 -05:00
parent 71e636cf49
commit d7e5158a09

View file

@ -2079,9 +2079,12 @@ setNonBlocking(SOCKET fd)
{
errno = error;
[self _recordError];
[_sibling _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
[_sibling _sendEvent: NSStreamEventErrorOccurred];
if ([_sibling streamStatus] == NSStreamStatusOpening)
{
[_sibling _recordError];
[_sibling _sendEvent: NSStreamEventErrorOccurred];
}
}
else
{
@ -2525,9 +2528,12 @@ setNonBlocking(SOCKET fd)
{
errno = error;
[self _recordError];
[_sibling _recordError];
[self _sendEvent: NSStreamEventErrorOccurred];
[_sibling _sendEvent: NSStreamEventErrorOccurred];
if ([_sibling streamStatus] == NSStreamStatusOpening)
{
[_sibling _recordError];
[_sibling _sendEvent: NSStreamEventErrorOccurred];
}
}
else
{