fix for possible error when receiving out of bad data

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28108 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-03-21 09:04:02 +00:00
parent b4e0b8fcf9
commit 23f68cd57f
3 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2009-03-21 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSMessagePort.m:
* Source/NSSocketPort.m:
Fix to treat exceptional (out of band) event as meaning a readable
rather than a writable descriptor.
2009-03-20 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSURLCredential.m:

View file

@ -536,7 +536,7 @@ static Class runLoopClass;
{
NSDebugMLLog(@"NSMessagePort_details",
@"received %s event on 0x%x",
type == ET_RPORT ? "read" : "write", self);
type != ET_WDESC ? "read" : "write", self);
/*
* If we have been invalidated (desc < 0) then we should ignore this
* event and remove ourself from the runloop.
@ -558,7 +558,7 @@ static Class runLoopClass;
M_LOCK(myLock);
if (type == ET_RPORT)
if (type != ET_WDESC)
{
unsigned want;
void *bytes;

View file

@ -1229,7 +1229,7 @@ static Class runLoopClass;
WSANETWORKEVENTS ocurredEvents;
#endif
NSDebugMLLog(@"GSTcpHandle", @"received %s event on 0x%x",
type == ET_RPORT ? "read" : "write", self);
type != ET_WDESC ? "read" : "write", self);
/*
* If we have been invalidated (desc < 0) then we should ignore this
* event and remove ourself from the runloop.
@ -1326,7 +1326,7 @@ static Class runLoopClass;
abort();
}
#else
if (type == ET_RPORT)
if (type != ET_WDESC)
{
[self receivedEventRead];
}