supress bad fd message when circuit is aborted

This commit is contained in:
Jeff Hill
2002-07-23 15:23:10 +00:00
parent d665b671d9
commit ef98383a54
+9 -1
View File
@@ -192,7 +192,7 @@ unsigned tcpiiu::sendBytes ( const void *pBuf,
return nBytes;
}
unsigned tcpiiu::recvBytes ( void *pBuf, unsigned nBytesInBuf )
unsigned tcpiiu::recvBytes ( void * pBuf, unsigned nBytesInBuf )
{
if ( this->state != iiucs_connected &&
this->state != iiucs_clean_shutdown ) {
@@ -203,6 +203,14 @@ unsigned tcpiiu::recvBytes ( void *pBuf, unsigned nBytesInBuf )
int status = ::recv ( this->sock, static_cast <char *> ( pBuf ),
static_cast <int> ( nBytesInBuf ), 0 );
// if the circuit was aborted then supress warning message about
// bad file descriptor
if ( this->state != iiucs_connected &&
this->state != iiucs_clean_shutdown ) {
return 0u;
}
if ( status <= 0 ) {
int localErrno = SOCKERRNO;