diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index 4b882d506..7e08a0b99 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -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 ( pBuf ), static_cast ( 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;