From fbb7e014c0b57d69acdd3b59345dca0cdd8ebc97 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 28 Oct 1999 18:46:40 +0000 Subject: [PATCH] moved ukn msg action to strm and dg clients --- src/cas/generic/casClient.cc | 26 -------------------------- src/cas/generic/casDGClient.cc | 25 +++++++++++++++++++------ 2 files changed, 19 insertions(+), 32 deletions(-) diff --git a/src/cas/generic/casClient.cc b/src/cas/generic/casClient.cc index 09c3ad948..7d9e406ed 100644 --- a/src/cas/generic/casClient.cc +++ b/src/cas/generic/casClient.cc @@ -285,32 +285,6 @@ caStatus casClient::ignoreMsgAction () return S_cas_success; } -/* - * casClient::uknownMessageAction() - */ -caStatus casClient::uknownMessageAction () -{ - const caHdr *mp = this->ctx.getMsg(); - caStatus status; - - ca_printf ("CAS: bad message type=%u\n", mp->m_cmmd); - this->dumpMsg (mp, this->ctx.getData() ); - - /* - * most clients dont recover from this - */ - status = this->sendErr (mp, ECA_INTERNAL, "Invalid Msg Type"); - if (status) { - return status; - } - - /* - * returning S_cas_internal here disconnects - * the client with the bad message - */ - return S_cas_internal; -} - // // what gets called if the derived class does not supply a // message handler for the message type (and it isnt a generic diff --git a/src/cas/generic/casDGClient.cc b/src/cas/generic/casDGClient.cc index 507177ee7..e359e94b9 100644 --- a/src/cas/generic/casDGClient.cc +++ b/src/cas/generic/casDGClient.cc @@ -36,6 +36,7 @@ #include "dgInBufIL.h" // dgInBuf inline func #include "casCtxIL.h" // casCtx inline func #include "casCoreClientIL.h" // casCoreClient inline func +#include "osiPoolStatus.h" // osi pool monitoring functions // // CA Server Datagram (DG) Client @@ -80,6 +81,19 @@ void casDGClient::show (unsigned level) const this->inBuf::show(level); } +// +// casDGClient::uknownMessageAction() +// +caStatus casDGClient::uknownMessageAction () +{ + const caHdr *mp = this->ctx.getMsg(); + + ca_printf ("CAS: bad request code in DG =%u\n", mp->m_cmmd); + this->dumpMsg (mp, this->ctx.getData()); + + return S_cas_internal; +} + // // casDGClient::searchAction() // @@ -103,10 +117,9 @@ caStatus casDGClient::searchAction() // search requests, and therefore dont thrash through // caServer::pvExistTest() and casCreatePV::pvAttach() // -#ifdef vxWorks -# error code needs to be implemented here when we port -# error to memory limited environment -#endif + if (!osiSufficentSpaceInPool()) { + return S_cas_success; + } // // ask the server tool if this PV exists @@ -391,7 +404,7 @@ inBuf::fillCondition casDGClient::xRecv (char *pBufIn, bufSizeT nBytesToRecv, inBuf::fillCondition stat; cadg *pHdr; - while (pAfter-pBuf >= MAX_UDP+sizeof(cadg)) { + while (pAfter-pBuf >= static_cast(MAX_UDP+sizeof(cadg))) { pHdr = reinterpret_cast(pBuf); stat = this->osdRecv (reinterpret_cast(pHdr+1), MAX_UDP, parm, nDGBytesRecv, pHdr->cadg_addr); @@ -462,7 +475,7 @@ caStatus casDGClient::processDG () caStatus status; status = S_cas_success; - while (bytesLeft = this->inBuf::bytesPresent()) { + while ( (bytesLeft = this->inBuf::bytesPresent()) ) { bufSizeT dgInBytesConsumed; const cadg *pReqHdr = reinterpret_cast(this->inBuf::msgPtr ());