From ef98383a54170a24ac1b7e51686fdc0ced3be7d8 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 23 Jul 2002 15:23:10 +0000 Subject: [PATCH] supress bad fd message when circuit is aborted --- src/ca/tcpiiu.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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;