本文整理汇总了C++中CondorError::message方法的典型用法代码示例。如果您正苦于以下问题:C++ CondorError::message方法的具体用法?C++ CondorError::message怎么用?C++ CondorError::message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CondorError
的用法示例。
在下文中一共展示了CondorError::message方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unmonitorLogFile
// Note: logfile is not passed as a reference because we need a local
// copy to modify anyhow.
bool
ReadMultipleUserLogs::unmonitorLogFile( MyString logfile,
CondorError &errstack )
{
dprintf( D_LOG_FILES, "ReadMultipleUserLogs::unmonitorLogFile(%s)\n",
logfile.Value() );
MyString fileID;
if ( !GetFileID( logfile, fileID, errstack ) ) {
errstack.push( "ReadMultipleUserLogs", UTIL_ERR_LOG_FILE,
"Error getting file ID in unmonitorLogFile()" );
return false;
}
LogFileMonitor *monitor;
if ( activeLogFiles.lookup( fileID, monitor ) != 0 ) {
errstack.pushf( "ReadMultipleUserLogs", UTIL_ERR_LOG_FILE,
"Didn't find LogFileMonitor object for log "
"file %s (%s)!", logfile.Value(),
fileID.Value() );
dprintf( D_ALWAYS, "ReadMultipleUserLogs error: %s\n",
errstack.message() );
printAllLogMonitors( NULL );
return false;
}
dprintf( D_LOG_FILES, "ReadMultipleUserLogs: found "
"LogFileMonitor object for %s (%s)\n",
logfile.Value(), fileID.Value() );
monitor->refCount--;
if ( monitor->refCount < 1 ) {
// Okay, if we are no longer monitoring this file at all,
// we need to close it. We do that by saving its state
// into a ReadUserLog::FileState object (so we can go back
// to the right place if we later monitor it again) and
// then deleting the ReadUserLog object.
dprintf( D_LOG_FILES, "Closing file <%s>\n", logfile.Value() );
if ( !monitor->state ) {
monitor->state = new ReadUserLog::FileState();
if ( !ReadUserLog::InitFileState( *(monitor->state) ) ) {
errstack.pushf( "ReadMultipleUserLogs", UTIL_ERR_LOG_FILE,
"Unable to initialize ReadUserLog::FileState "
"object for log file %s", logfile.Value() );
monitor->stateError = true;
delete monitor->state;
monitor->state = NULL;
return false;
}
}
if ( !monitor->readUserLog->GetFileState( *(monitor->state) ) ) {
errstack.pushf( "ReadMultipleUserLogs", UTIL_ERR_LOG_FILE,
"Error getting state for log file %s",
logfile.Value() );
monitor->stateError = true;
delete monitor->state;
monitor->state = NULL;
return false;
}
delete monitor->readUserLog;
monitor->readUserLog = NULL;
// Now we remove this file from the "active" list, so
// we don't check it the next time we get an event.
if ( activeLogFiles.remove( fileID ) != 0 ) {
errstack.pushf( "ReadMultipleUserLogs", UTIL_ERR_LOG_FILE,
"Error removing %s (%s) from activeLogFiles",
logfile.Value(), fileID.Value() );
dprintf( D_ALWAYS, "ReadMultipleUserLogs error: %s\n",
errstack.message() );
printAllLogMonitors( NULL );
return false;
}
dprintf( D_LOG_FILES, "ReadMultipleUserLogs: removed "
"log file %s (%s) from active list\n",
logfile.Value(), fileID.Value() );
}
return true;
}
示例2: list
int
do_Q_request(ReliSock *syscall_sock,bool &may_fork)
{
int request_num = -1;
int rval;
syscall_sock->decode();
assert( syscall_sock->code(request_num) );
dprintf(D_SYSCALLS, "Got request #%d\n", request_num);
switch( request_num ) {
case CONDOR_InitializeConnection:
{
// dprintf( D_ALWAYS, "InitializeConnection()\n" );
bool authenticated = true;
// Authenticate socket, if not already done by daemonCore
if( !syscall_sock->triedAuthentication() ) {
if( IsDebugLevel(D_SECURITY) ) {
MyString methods;
SecMan::getAuthenticationMethods( WRITE, &methods );
dprintf(D_SECURITY,"Calling authenticate(%s) in qmgmt_receivers\n", methods.Value());
}
CondorError errstack;
if( ! SecMan::authenticate_sock(syscall_sock, WRITE, &errstack) ) {
// Failed to authenticate
dprintf( D_ALWAYS, "SCHEDD: authentication failed: %s\n",
errstack.getFullText().c_str() );
authenticated = false;
}
}
if ( authenticated ) {
InitializeConnection( syscall_sock->getOwner(),
syscall_sock->getDomain() );
} else {
InitializeConnection( NULL, NULL );
}
return 0;
}
case CONDOR_InitializeReadOnlyConnection:
{
// dprintf( D_ALWAYS, "InitializeReadOnlyConnection()\n" );
// Since InitializeConnection() does nothing, and we need
// to record the fact that this is a read-only connection,
// but we have to do it in the socket (since we don't have
// any other persistent data structure, and it's probably
// the right place anyway), set the FQU.
//
// We need to record if this is a read-only connection so that
// we can avoid expanding $$ in GetJobAd; simply checking if the
// connection is authenticated isn't sufficient, because the
// security session cache means that read-only connection could
// be authenticated by a previous authenticated connection from
// the same address (when using host-based security) less than
// the expiration period ago.
syscall_sock->setFullyQualifiedUser( "read-only" );
// same as InitializeConnection but no authenticate()
InitializeConnection( NULL, NULL );
may_fork = true;
return 0;
}
case CONDOR_SetEffectiveOwner:
{
MyString owner;
int terrno;
assert( syscall_sock->get(owner) );
assert( syscall_sock->end_of_message() );
rval = QmgmtSetEffectiveOwner( owner.Value() );
terrno = errno;
syscall_sock->encode();
assert( syscall_sock->code(rval) );
if( rval < 0 ) {
assert( syscall_sock->code(terrno) );
}
assert( syscall_sock->end_of_message() );
char const *fqu = syscall_sock->getFullyQualifiedUser();
dprintf(D_SYSCALLS, "\tSetEffectiveOwner\n");
dprintf(D_SYSCALLS, "\tauthenticated user = '%s'\n", fqu ? fqu : "");
dprintf(D_SYSCALLS, "\trequested owner = '%s'\n", owner.Value());
dprintf(D_SYSCALLS, "\trval %d, errno %d\n", rval, terrno);
return 0;
}
case CONDOR_NewCluster:
{
int terrno;
//.........这里部分代码省略.........