Commit fca99527 authored by Steven Murray's avatar Steven Murray
Browse files

Completed castor::legacymsg::CupvProxyTcpIp::isGranted() for tapeserverd and rmc work

parent 380362cd
......@@ -78,16 +78,18 @@ bool castor::legacymsg::CupvProxyTcpIp::isGranted(
const MessageHeader header = readCupvMsgHeader(fd.get());
switch(header.reqType) {
case CUPV_IRC:
return true;
case CUPV_RC:
if(0 != header.lenOrStatus) {
switch(header.lenOrStatus) {
case 0:
return true;
case EACCES:
return false;
default:
castor::exception::Exception ex;
ex.getMessage() << "Received error code from cupv running on " <<
m_cupvHostName << ": code=" << header.lenOrStatus;
throw ex;
}
break;
case MSG_ERR:
{
char errorBuf[1024];
......@@ -100,7 +102,6 @@ bool castor::legacymsg::CupvProxyTcpIp::isGranted(
m_cupvHostName << ": " << errorBuf;
throw ex;
}
break;
default:
{
castor::exception::Exception ex;
......@@ -117,7 +118,6 @@ bool castor::legacymsg::CupvProxyTcpIp::isGranted(
ex.getMessage() << "Failed to " << task.str() << ": " << ne.getMessage().str();
throw ex;
}
return false;
}
//-----------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment