version 1.4, 2014/12/04 17:18:36
|
version 1.5, 2014/12/06 21:26:30
|
|
|
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
// defines conversion between sec and usec |
|
#define PEG_MICROSEC 1000000 |
|
|
#define MAX_ZERO_PULL_OPERATIONS 1000 | #define MAX_ZERO_PULL_OPERATIONS 1000 |
| |
// When set enables the diagnostic traces in this class | // When set enables the diagnostic traces in this class |
|
|
// Request operation timeout = 0 means do not start timer | // Request operation timeout = 0 means do not start timer |
if (_operationTimeoutSec != 0) | if (_operationTimeoutSec != 0) |
{ | { |
startTimer(_operationTimeoutSec * 1000000); |
startTimer(_operationTimeoutSec * PEG_MICROSEC); |
} | } |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
|
|
" OperationTimeout=%u sec," | " OperationTimeout=%u sec," |
" next timeout in %ld sec,", | " next timeout in %ld sec,", |
(const char*)getContextId().getCString(), | (const char*)getContextId().getCString(), |
(timeoutUsec / 1000000), |
(timeoutUsec / PEG_MICROSEC), |
_operationTimeoutSec, | _operationTimeoutSec, |
(long signed int)(_operationTimerUsec - currentTime)/1000000 )); |
(long signed int)(_operationTimerUsec - currentTime)/PEG_MICROSEC )); |
#endif | #endif |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
|
|
(const char*)getContextId().getCString(), | (const char*)getContextId().getCString(), |
_operationTimeoutSec, | _operationTimeoutSec, |
(long signed int)(_operationTimerUsec - | (long signed int)(_operationTimerUsec - |
System::getCurrentTimeUsec())/1000000 )); |
System::getCurrentTimeUsec())/PEG_MICROSEC )); |
#endif | #endif |
_operationTimerUsec = 0; | _operationTimerUsec = 0; |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
return false; | return false; |
} | } |
| |
bool timedOut = (_operationTimerUsec <= currentTime)? true : false; |
bool timedOut = _operationTimerUsec <= currentTime; |
| |
#ifdef ENUMERATION_CONTEXT_DIAGNOSTIC_TRACE | #ifdef ENUMERATION_CONTEXT_DIAGNOSTIC_TRACE |
PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, | PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, |
"isTimedOut Timer. ContextId=%s timer(sec)=%lu" | "isTimedOut Timer. ContextId=%s timer(sec)=%lu" |
" current(sec)=%lu time to timeout(sec)=%ld isTimedOut=%s", |
" current(sec)=%lu time to timeout(usec)=%ld isTimedOut=%s", |
(const char*)_contextId.getCString(), | (const char*)_contextId.getCString(), |
(long unsigned int)(_operationTimerUsec / 1000000), |
(long unsigned int)(_operationTimerUsec / PEG_MICROSEC), |
(long unsigned int)(currentTime / 1000000), |
(long unsigned int)(currentTime / PEG_MICROSEC), |
(long signed int)((_operationTimerUsec - currentTime) / 1000000), |
(long signed int)((_operationTimerUsec - currentTime)), |
boolToString(timedOut) )); | boolToString(timedOut) )); |
#endif | #endif |
// If it is timed out, set timer inactive. | // If it is timed out, set timer inactive. |
|
|
CIMResponseData & from = localResponse->getResponseData(); | CIMResponseData & from = localResponse->getResponseData(); |
| |
// If there is any binary data, reformat it to SCMO. There are no | // If there is any binary data, reformat it to SCMO. There are no |
// size counters for the binary data so we reformat to generate |
// size counters for the binary data so reformat to generate |
// counters. |
// counters and make it compatible with the cache access mechanisms |
if (from.hasBinaryData()) | if (from.hasBinaryData()) |
{ | { |
from.resolveBinaryToSCMO(); | from.resolveBinaryToSCMO(); |
|
|
| |
#ifdef ENUMERATION_CONTEXT_DIAGNOSTIC_TRACE | #ifdef ENUMERATION_CONTEXT_DIAGNOSTIC_TRACE |
PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, | PEG_TRACE((TRC_DISPATCHER, Tracer::LEVEL4, |
"testCacheForResponse returns %s", boolToString(rtn) )); |
"testCacheForResponse returns %s for ContextId=", |
|
boolToString(rtn), (const char*)getContextId().getCString() )); |
#endif | #endif |
return rtn; | return rtn; |
} | } |
| |
void EnumerationContext::saveNextResponse( |
void EnumerationContext::setupDelayedResponse( |
CIMOperationRequestMessage* request, | CIMOperationRequestMessage* request, |
CIMOpenOrPullResponseDataMessage* response, | CIMOpenOrPullResponseDataMessage* response, |
Uint32 operationMaxObjectCount) | Uint32 operationMaxObjectCount) |
|
|
_savedOperationMaxObjectCount = operationMaxObjectCount; | _savedOperationMaxObjectCount = operationMaxObjectCount; |
_savedResponse = response; | _savedResponse = response; |
_savedRequest = request; | _savedRequest = request; |
|
|
|
// Start the waiting timeout for this delayed response. |
|
// At end of this timer, it will send empty response. |
|
startTimer(PEGASUS_PULL_MAX_OPERATION_WAIT_SEC * PEG_MICROSEC); |
} | } |
/* | /* |
Move the number of objects defined by count from the CIMResponseData | Move the number of objects defined by count from the CIMResponseData |