(file) Return to Tracer.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Tracer.cpp between version 1.63.2.4 and 1.64

version 1.63.2.4, 2014/03/12 22:35:02 version 1.64, 2011/01/25 12:10:21
Line 63 
Line 63 
  
        Tracer::setTraceComponents("Config,Repository");        Tracer::setTraceComponents("Config,Repository");
 */ */
 char const* Tracer::TRACE_COMPONENT_LIST[] =  static char const* TRACE_COMPONENT_LIST[] =
 { {
     "Xml",     "Xml",
     "XmlIO",     "XmlIO",
Line 101 
Line 101 
     "IndicationReceipt",     "IndicationReceipt",
     "CMPIProviderInterface",     "CMPIProviderInterface",
     "WsmServer",     "WsmServer",
     "RsServer",  
 #ifdef PEGASUS_ENABLE_PROTOCOL_WEB  
     "WebServer",  
 #endif  
     "LogMessages",     "LogMessages",
     "WMIMapperConsumer",      "WMIMapperConsumer"
     "InternalProvider"  
 }; };
  
 // Set the number of defined components  
 const Uint32 Tracer::_NUM_COMPONENTS =  
     sizeof(TRACE_COMPONENT_LIST)/sizeof(TRACE_COMPONENT_LIST[0]);  
   
  
 // Defines the value values for trace facilities // Defines the value values for trace facilities
 // Keep the TRACE_FACILITY_LIST in sync with the TRACE_FACILITY_INDEX, // Keep the TRACE_FACILITY_LIST in sync with the TRACE_FACILITY_INDEX,
Line 148 
Line 139 
 // Set component separator // Set component separator
 const char Tracer::_COMPONENT_SEPARATOR = ','; const char Tracer::_COMPONENT_SEPARATOR = ',';
  
   // Set the number of defined components
   const Uint32 Tracer::_NUM_COMPONENTS =
       sizeof(TRACE_COMPONENT_LIST)/sizeof(TRACE_COMPONENT_LIST[0]);
   
 // Set the line maximum // Set the line maximum
 const Uint32 Tracer::_STRLEN_MAX_UNSIGNED_INT = 21; const Uint32 Tracer::_STRLEN_MAX_UNSIGNED_INT = 21;
  
Line 331 
Line 326 
         len = sprintf(targetBuffer, "%02X", c);         len = sprintf(targetBuffer, "%02X", c);
         targetBuffer+=len;         targetBuffer+=len;
  
         if ( ((col+1) & 3) == 0 )          if ( ((col+1)%4) == 0 )
         {         {
             *targetBuffer = ' ';             *targetBuffer = ' ';
             targetBuffer++;             targetBuffer++;
Line 456 
Line 451 
     char* sep;     char* sep;
     const char* line = requestBuf.get();     const char* line = requestBuf.get();
  
     while ((sep = HTTPMessage::findSeparator(line)) && (line != sep))      while ((sep = HTTPMessage::findSeparator(
           line, (Uint32)(requestSize - (line - requestBuf.get())))) &&
           (line != sep))
     {     {
         if (HTTPMessage::expectHeaderToken(line, "Authorization") &&         if (HTTPMessage::expectHeaderToken(line, "Authorization") &&
              HTTPMessage::expectHeaderToken(line, ":") &&              HTTPMessage::expectHeaderToken(line, ":") &&
Line 611 
Line 608 
     else     else
     {     {
         //         //
           // Since the message is blank, form a string using the pid and tid
           //
           char* tmpBuffer;
   
           //
         // Allocate messageHeader.         // Allocate messageHeader.
         // Needs to be updated if additional info is added         // Needs to be updated if additional info is added
         //         //
Line 1102 
Line 1104 
  
 #endif /* !PEGASUS_REMOVE_TRACE */ #endif /* !PEGASUS_REMOVE_TRACE */
  
 //set the trace file size only when the tracing is on a file  
 void Tracer::setMaxTraceFileSize(const String &size)  
 {  
     Tracer *inst = _getInstance();  
     if ( inst->getTraceFacility() == TRACE_FACILITY_FILE )  
     {  
         Uint32 traceFileSizeKBytes = 0;  
         tracePropertyToUint32(size, traceFileSizeKBytes);  
   
         //Safe to typecast here as we know that handler is of type file  
         TraceFileHandler *hdlr = (TraceFileHandler*) (inst->_traceHandler);  
   
         hdlr->setMaxTraceFileSize(traceFileSizeKBytes*1024);  
   
     }  
 }  
   
 //set the trace file number for rolling only when the tracing is on a file  
 void Tracer::setMaxTraceFileNumber(const String &maxTraceFileNumber)  
 {  
     Tracer *inst = _getInstance();  
   
     if ( inst->getTraceFacility() == TRACE_FACILITY_FILE )  
     {  
         Uint32 numberOfTraceFiles = 0;  
         tracePropertyToUint32(maxTraceFileNumber, numberOfTraceFiles);  
   
         //Safe to typecast here as we know that handler is of type file  
         TraceFileHandler *hdlr = (TraceFileHandler*) (inst->_traceHandler);  
   
         hdlr->setMaxTraceFileNumber(numberOfTraceFiles);  
      }  
 }  
   
 //  
 // Converts the quantifiable trace  proprties string into a Uint32 value.  
 // It returns false and the bufferSize is set to 0 if the string was not valid.  
 //  
 Boolean Tracer::tracePropertyToUint32(  
     const String& traceProperty, Uint32& valueInUint32 )  
 {  
     Boolean retCode = false;  
     Uint64 uInt64BufferSize;  
   
     valueInUint32 = 0;  
     CString stringBufferSize = traceProperty.getCString();  
   
   
     retCode = StringConversion::decimalStringToUint64(stringBufferSize,  
                                                       uInt64BufferSize);  
   
     if (retCode )  
     {  
         retCode = StringConversion::checkUintBounds(uInt64BufferSize,  
                                                     CIMTYPE_UINT32);  
     }  
   
     if (retCode )  
     {  
         valueInUint32 = (Uint32)uInt64BufferSize;  
     }  
   
     return retCode;  
 }  
   
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.63.2.4  
changed lines
  Added in v.1.64

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2