cas: ignore CA client version older than v4.4

CAS ignore search and version messages
from CA minor versions older than 4.4.
This commit is contained in:
Michael Davidsaver
2016-07-30 11:45:42 -04:00
parent da78e01e89
commit ebfaca8228
2 changed files with 39 additions and 0 deletions

View File

@@ -131,6 +131,16 @@ caStatus casDGClient::searchAction()
const char *pChanName = static_cast <char * > ( this->ctx.getData() );
caStatus status;
if (!CA_VSUPPORTED(mp->m_count)) {
if ( this->getCAS().getDebugLevel() > 3u ) {
char pHostName[64u];
this->hostName ( pHostName, sizeof ( pHostName ) );
printf ( "\"%s\" is searching for \"%s\" but is too old\n",
pHostName, pChanName );
}
return S_cas_badProtocol;
}
//
// check the sanity of the message
//
@@ -368,6 +378,15 @@ caStatus casDGClient::versionAction ()
{
const caHdrLargeArray * mp = this->ctx.getMsg();
if (!CA_VSUPPORTED(mp->m_count)) {
if ( this->getCAS().getDebugLevel() > 3u ) {
char pHostName[64u];
this->hostName ( pHostName, sizeof ( pHostName ) );
printf ( "\"%s\" is too old\n",
pHostName );
}
return S_cas_badProtocol;
}
if ( mp->m_count != 0 ) {
this->minor_version_number = static_cast <ca_uint16_t> ( mp->m_count );
if ( CA_V411 ( mp->m_count ) ) {

View File

@@ -338,6 +338,16 @@ caStatus casStrmClient::versionAction ( epicsGuard < casClientMutex > & )
return S_cas_badProtocol;
}
if (!CA_VSUPPORTED(mp->m_count)) {
if ( this->getCAS().getDebugLevel() > 3u ) {
char pHostName[64u];
this->hostName ( pHostName, sizeof ( pHostName ) );
printf ( "\"%s\" is too old\n",
pHostName );
}
return S_cas_badProtocol;
}
double tmp = mp->m_dataType - CA_PROTO_PRIORITY_MIN;
tmp *= epicsThreadPriorityCAServerHigh - epicsThreadPriorityCAServerLow;
tmp /= CA_PROTO_PRIORITY_MAX - CA_PROTO_PRIORITY_MIN;
@@ -1322,6 +1332,16 @@ caStatus casStrmClient :: searchAction ( epicsGuard < casClientMutex > & guard )
const char *pChanName = static_cast <char * > ( this->ctx.getData() );
caStatus status;
if (!CA_VSUPPORTED(mp->m_count)) {
if ( this->getCAS().getDebugLevel() > 3u ) {
char pHostName[64u];
this->hostName ( pHostName, sizeof ( pHostName ) );
printf ( "\"%s\" is searching for \"%s\" but is too old\n",
pHostName, pChanName );
}
return S_cas_badProtocol;
}
//
// check the sanity of the message
//