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

Diff for /pegasus/src/Pegasus/Common/XmlWriter.cpp between version 1.128 and 1.145

version 1.128, 2005/10/31 22:35:04 version 1.145, 2006/11/01 20:29:49
Line 1 
Line 1 
 //%2005////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
Line 8 
Line 8 
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 // EMC Corporation; VERITAS Software Corporation; The Open Group. // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 39 
Line 41 
 //                               Willis White (whiwill@us.ibm.com) PEP 127 and 128 //                               Willis White (whiwill@us.ibm.com) PEP 127 and 128
 //         Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2 //         Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2
 //              Dave Sudlik, IBM (dsudlik@us.ibm.com) //              Dave Sudlik, IBM (dsudlik@us.ibm.com)
 //              David Dillard, VERITAS Software Corp.  //              David Dillard, Symantec Corp. (david_dillard@symantec.com)
 //                  (david.dillard@veritas.com)  
 //              Vijay Eli, vijayeli@in.ibm.com, fix for #2571 //              Vijay Eli, vijayeli@in.ibm.com, fix for #2571
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
Line 73 
Line 74 
 #include "CommonUTF.h" #include "CommonUTF.h"
 #include "Buffer.h" #include "Buffer.h"
 #include "StrLit.h" #include "StrLit.h"
   #include "LanguageParser.h"
   #include "IDFactory.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 86 
Line 89 
 #define OUTPUT_CONTENTLENGTH                                               \ #define OUTPUT_CONTENTLENGTH                                               \
 {                                                                          \ {                                                                          \
     char contentLengthP[11];                                               \     char contentLengthP[11];                                               \
     sprintf(contentLengthP,"%.10u", contentLength);                        \      int n = sprintf(contentLengthP,"%.10u", contentLength);                \
     out << STRLIT("content-length: ") << contentLengthP << STRLIT("\r\n"); \      out << STRLIT("content-length: ");                                     \
       out.append(contentLengthP, n);                                         \
       out << STRLIT("\r\n");                                                 \
 } }
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Line 246 
Line 251 
 static const int _isSpecialChar7[] = static const int _isSpecialChar7[] =
 { {
     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,
     0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,      0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
 }; };
  
 //////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
  
 Buffer& operator<<(Buffer& out, const char* x)  
 {  
     XmlWriter::append(out, x);  
     return out;  
 }  
   
 Buffer& operator<<(Buffer& out, char x)  
 {  
     XmlWriter::append(out, x);  
     return out;  
 }  
   
 Buffer& operator<<(Buffer& out, const Char16& x) Buffer& operator<<(Buffer& out, const Char16& x)
 { {
     XmlWriter::append(out, x);     XmlWriter::append(out, x);
Line 303 
Line 296 
  
  
 // l10n // l10n
 Buffer& operator<<(Buffer& out, const AcceptLanguages& al)  Buffer& operator<<(Buffer& out, const AcceptLanguageList& al)
 { {
     XmlWriter::append(out, al.toString ());      XmlWriter::append(out, LanguageParser::buildAcceptLanguageHeader(al));
     return out;     return out;
 } }
  
 // l10n // l10n
 Buffer& operator<<(Buffer& out, const ContentLanguages& cl)  Buffer& operator<<(Buffer& out, const ContentLanguageList& cl)
 { {
     XmlWriter::append(out, cl.toString ());      XmlWriter::append(out, LanguageParser::buildContentLanguageHeader(cl));
     return out;     return out;
 } }
  
Line 584 
Line 577 
 void XmlWriter::appendSpecial(Buffer& out, const String& str) void XmlWriter::appendSpecial(Buffer& out, const String& str)
 { {
     const Uint16* p = (const Uint16*)str.getChar16Data();     const Uint16* p = (const Uint16*)str.getChar16Data();
     size_t n = str.size();      // prevCharIsSpace is true when the last character written to the Buffer
       // is a space character (not a character reference).
     // Handle leading ASCII 7 characers in these next two loops (use unrolling).      Boolean prevCharIsSpace = false;
   
     while (n >= 8)      // If the first character is a space, use a character reference to avoid
       // space compression.
       if (*p == ' ')
     {     {
         // The following condition is equivalent to this:          out.append(STRLIT_ARGS("&#32;"));
         //     (p[0] < 128 && p[1] < 128 && p[2] < 128 && p[3] < 128 &&          p++;
         //      p[4] < 128 && p[5] < 128 && p[6] < 128 && p[7] < 128)      }
  
         if (((p[0]|p[1]|p[2]|p[3]|p[4]|p[5]|p[6]|p[7]) & 0xFF80) == 0)      Uint16 c;
       while ((c = *p++) != 0)
         {         {
             // Note: "|" is faster than "||" and achieves the same effect          if (c < 128)
             // since p[i] is either 0 or 1.  
   
             if (_isSpecialChar7[p[0]] | _isSpecialChar7[p[1]] |  
                 _isSpecialChar7[p[2]] | _isSpecialChar7[p[3]] |  
                 _isSpecialChar7[p[4]] | _isSpecialChar7[p[5]] |  
                 _isSpecialChar7[p[6]] | _isSpecialChar7[p[7]])  
             {             {
                 // Rare case.              if (_isSpecialChar7[c])
                 _appendSpecialChar7(out, p[0]);              {
                 _appendSpecialChar7(out, p[1]);                  // Write the character reference for the special character
                 _appendSpecialChar7(out, p[2]);                  out.append(
                 _appendSpecialChar7(out, p[3]);                      _specialChars[int(c)].str, _specialChars[int(c)].size);
                 _appendSpecialChar7(out, p[4]);                  prevCharIsSpace = false;
                 _appendSpecialChar7(out, p[5]);              }
                 _appendSpecialChar7(out, p[6]);              else if (prevCharIsSpace && (c == ' '))
                 _appendSpecialChar7(out, p[7]);              {
                   // Write the character reference for the space character, to
                   // avoid compression
                   out.append(STRLIT_ARGS("&#32;"));
                   prevCharIsSpace = false;
             }             }
             else             else
             {             {
                 // Common case.                  out.append(c);
                 out.append(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);                  prevCharIsSpace = (c == ' ');
             }             }
             p += 8;  
             n -= 8;  
         }         }
         else         else
             break;  
     }  
   
     while (n >= 4)  
     {     {
         // The following condition is equivalent to this:              // Handle UTF8 case
         //     (p[0] < 128 && p[1] < 128 && p[2] < 128 && p[3] < 128)  
  
         if (((p[0]|p[1]|p[2]|p[3]) & 0xFF80) == 0)              if ((((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||
         {                   ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE))) &&
             if (_isSpecialChar7[p[0]] | _isSpecialChar7[p[1]] |                  *p)
                 _isSpecialChar7[p[2]] | _isSpecialChar7[p[3]])  
             {             {
                 // Rare case:                  _xmlWritter_appendSurrogatePair(out, c, *p++);
                 _appendSpecialChar7(out, p[0]);  
                 _appendSpecialChar7(out, p[1]);  
                 _appendSpecialChar7(out, p[2]);  
                 _appendSpecialChar7(out, p[3]);  
             }             }
             else             else
             {             {
                 // Common case:                  _xmlWritter_appendChar(out, c);
                 out.append(p[0], p[1], p[2], p[3]);  
             }             }
  
             p += 4;              prevCharIsSpace = false;
             n -= 4;  
         }         }
         else  
             break;  
     }     }
  
     // Process remaining characters. A UTF8 character must have been      // If the last character is a space, use a character reference to avoid
     // encountered or this would have never been reached.      // space compression.
       if (prevCharIsSpace)
     while (n--)  
     {  
         Uint16 c = *p++;  
   
         // Special processing for UTF8 case:  
   
         if (c < 128)  
         {  
             _appendSpecialChar7(out, c);  
             continue;  
         }  
   
         // Hanlde UTF8 case (if reached).  
   
         if(((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||  
            ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE)))  
         {  
             Char16 highSurrogate = p[-1];  
             Char16 lowSurrogate = p[0];  
             p++;  
             n--;  
   
             _xmlWritter_appendSurrogatePair(  
                 out, Uint16(highSurrogate),Uint16(lowSurrogate));  
         }  
         else  
         {         {
             _xmlWritter_appendSpecialChar(out, c);          out.remove(out.size() - 1);
         }          out.append(STRLIT_ARGS("&#32;"));
     }     }
 } }
  
Line 707 
Line 659 
     0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,     0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,
 }; };
  
   // Perform the necessary URI encoding of characters in HTTP header values.
   // This is required by the HTTP/1.1 specification and the CIM/HTTP
   // Specification (section 3.3.2).
 static void _xmlWritter_encodeURIChar(String& outString, Sint8 char8) static void _xmlWritter_encodeURIChar(String& outString, Sint8 char8)
 { {
     Uint8 c = (Uint8)char8;     Uint8 c = (Uint8)char8;
Line 800 
Line 755 
  
     char* nameSpaceCopy = strdup(nameSpace.getString().getCString());     char* nameSpaceCopy = strdup(nameSpace.getString().getCString());
  
 #if !defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)  #if !defined(PEGASUS_COMPILER_MSVC) && !defined(PEGASUS_OS_ZOS)
     char *last;     char *last;
     for (const char* p = strtok_r(nameSpaceCopy, "/", &last); p;     for (const char* p = strtok_r(nameSpaceCopy, "/", &last); p;
          p = strtok_r(NULL, "/", &last))          p = strtok_r(NULL, "/", &last))
Line 1072 
Line 1027 
  
 inline void _xmlWritter_appendValue(Buffer& out, const CIMDateTime& x) inline void _xmlWritter_appendValue(Buffer& out, const CIMDateTime& x)
 { {
     out << x.toString();  //ATTN: append() method?      // It is not necessary to use XmlWriter::appendSpecial(), because
       // CIMDateTime values do not contain special characters.
       out << x.toString();
 } }
  
 inline void _xmlWritter_appendValue(Buffer& out, const CIMObjectPath& x) inline void _xmlWritter_appendValue(Buffer& out, const CIMObjectPath& x)
Line 1265 
Line 1222 
                 _xmlWritter_appendValueArray(out, a.getData(), a.size());                 _xmlWritter_appendValueArray(out, a.getData(), a.size());
                 break;                 break;
             }             }
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
               case CIMTYPE_INSTANCE:
               {
                   Array<CIMInstance> a;
                   value.get(a);
                   _xmlWritter_appendValueArray(out, a.getData(), a.size());
                   break;
               }
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 1402 
Line 1367 
                 _xmlWritter_appendValue(out, v);                 _xmlWritter_appendValue(out, v);
                 break;                 break;
             }             }
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
               case CIMTYPE_INSTANCE:
               {
                   CIMInstance v;
                   value.get(v);
                   _xmlWritter_appendValue(out, v);
                   break;
               }
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
             default:             default:
                 PEGASUS_ASSERT(false);                 PEGASUS_ASSERT(false);
         }         }
Line 1930 
Line 1903 
     const String& cimObject,     const String& cimObject,
     const String& authenticationHeader,     const String& authenticationHeader,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const AcceptLanguages & acceptLanguages,      const AcceptLanguageList& acceptLanguages,
     const ContentLanguages & contentLanguages,      const ContentLanguageList& contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 1970 
Line 1943 
  
                 static const char *clientTransferEncodingOff =                 static const char *clientTransferEncodingOff =
                         getenv("PEGASUS_HTTP_TRANSFER_ENCODING_REQUEST");                         getenv("PEGASUS_HTTP_TRANSFER_ENCODING_REQUEST");
   
                 if (!clientTransferEncodingOff || *clientTransferEncodingOff != '0')                 if (!clientTransferEncodingOff || *clientTransferEncodingOff != '0')
 #endif #endif
  
Line 2006 
Line 1980 
 void XmlWriter::appendMethodResponseHeader( void XmlWriter::appendMethodResponseHeader(
      Buffer& out,      Buffer& out,
      HttpMethod httpMethod,      HttpMethod httpMethod,
      const ContentLanguages & contentLanguages,       const ContentLanguageList& contentLanguages,
      Uint32 contentLength,      Uint32 contentLength,
      Uint32 serverResponseTime)       Uint64 serverResponseTime)
 { {
      char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };      char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
      out << STRLIT("HTTP/1.1 " HTTP_STATUS_OK "\r\n");      out << STRLIT("HTTP/1.1 " HTTP_STATUS_OK "\r\n");
      STAT_SERVERTIME  
   #ifndef PEGASUS_DISABLE_PERFINST
        if (StatisticalData::current()->copyGSD)
        {
            out << STRLIT("WBEMServerResponseTime: ") <<
                CIMValue(serverResponseTime).toString() << STRLIT("\r\n");
        }
   #endif
   
      out << STRLIT("Content-Type: application/xml; charset=\"utf-8\"\r\n");      out << STRLIT("Content-Type: application/xml; charset=\"utf-8\"\r\n");
      OUTPUT_CONTENTLENGTH;      OUTPUT_CONTENTLENGTH;
  
Line 2062 
Line 2044 
     }     }
     if (errorDetail != String::EMPTY)     if (errorDetail != String::EMPTY)
     {     {
         // ATTN-RK-P3-20020404: It is critical that this text not contain '\n'  
         // ATTN-RK-P3-20020404: Need to encode this value properly.  (See  
         // CIM/HTTP Specification section 3.3.2  
         out << STRLIT(PEGASUS_HTTPHEADERTAG_ERRORDETAIL ": ")         out << STRLIT(PEGASUS_HTTPHEADERTAG_ERRORDETAIL ": ")
             << encodeURICharacters(errorDetail) << STRLIT("\r\n");             << encodeURICharacters(errorDetail) << STRLIT("\r\n");
     }     }
Line 2357 
Line 2336 
     out << STRLIT("<ERROR");     out << STRLIT("<ERROR");
     out << STRLIT(" CODE=\"") << Uint32(cimException.getCode());     out << STRLIT(" CODE=\"") << Uint32(cimException.getCode());
     out.append('"');     out.append('"');
   
     String description = TraceableCIMException(cimException).getDescription();     String description = TraceableCIMException(cimException).getDescription();
   
     if (description != String::EMPTY)     if (description != String::EMPTY)
     {     {
         out << STRLIT(" DESCRIPTION=\"");         out << STRLIT(" DESCRIPTION=\"");
         appendSpecial(out, description);         appendSpecial(out, description);
         out.append('"');         out.append('"');
     }     }
   
       if (cimException.getErrorCount())
       {
           out << STRLIT(">");
   
           for (Uint32 i = 0, n = cimException.getErrorCount(); i < n; i++)
               appendInstanceElement(out, cimException.getError(i));
   
           out << STRLIT("</ERROR>");
       }
       else
     out << STRLIT("/>");     out << STRLIT("/>");
 } }
  
Line 2395 
Line 2387 
         out << STRLIT(" PARAMTYPE=\"string\"");         out << STRLIT(" PARAMTYPE=\"string\"");
         out << STRLIT(" EMBEDDEDOBJECT=\"object\"");         out << STRLIT(" EMBEDDEDOBJECT=\"object\"");
     }     }
   #ifdef PEGASUS_EMBEDDED_INSTANCE_SUPPORT
       else if (type == CIMTYPE_INSTANCE)
       {
           out << STRLIT(" PARAMTYPE=\"string\"");
           out << STRLIT(" EMBEDDEDOBJECT=\"instance\"");
       }
   #endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
     else     else
     {     {
         out << STRLIT(" PARAMTYPE=\"") << cimTypeToString (type);         out << STRLIT(" PARAMTYPE=\"") << cimTypeToString (type);
Line 2470 
Line 2469 
  
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendQualifierNameIParameter()  
 //  
 //------------------------------------------------------------------------------  
   
 void XmlWriter::appendQualifierNameIParameter(  
     Buffer& out,  
     const char* name,  
     const String& qualifierName)  
 {  
     // <!ELEMENT IPARAMVALUE (VALUE|VALUE.ARRAY|VALUE.REFERENCE  
     //     |INSTANCENAME|CLASSNAME|QUALIFIER.DECLARATION  
     //     |CLASS|INSTANCE|VALUE.NAMEDINSTANCE)?>  
     //  
     // ATTN: notice that there is really no way to pass a qualifier name  
     // as an IPARAMVALUE element according to the spec (look above). So we  
     // just pass it as a class name. An answer must be obtained later.  
   
     _appendIParamValueElementBegin(out, name);  
     appendClassNameElement(out, qualifierName);  
     _appendIParamValueElementEnd(out);  
 }  
   
 //------------------------------------------------------------------------------  
 //  
 // appendClassNameIParameter() // appendClassNameIParameter()
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Line 2719 
Line 2694 
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
     const AcceptLanguages& httpAcceptLanguages,      const AcceptLanguageList& httpAcceptLanguages,
     const ContentLanguages& httpContentLanguages)      const ContentLanguageList& httpContentLanguages)
 { {
     Buffer out;     Buffer out;
     Buffer tmp;     Buffer tmp;
Line 2760 
Line 2735 
     const CIMName& methodName,     const CIMName& methodName,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const ContentLanguages & httpContentLanguages,      const ContentLanguageList& httpContentLanguages,
     const Buffer& body,     const Buffer& body,
                 Uint32 serverResponseTime,                  Uint64 serverResponseTime,
                 Boolean isFirst,                 Boolean isFirst,
                 Boolean isLast)                 Boolean isLast)
 { {
Line 2842 
Line 2817 
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
     const AcceptLanguages& httpAcceptLanguages,      const AcceptLanguageList& httpAcceptLanguages,
     const ContentLanguages& httpContentLanguages,      const ContentLanguageList& httpContentLanguages,
     const Buffer& body)     const Buffer& body)
 { {
     Buffer out;     Buffer out;
Line 2883 
Line 2858 
     const CIMName& iMethodName,     const CIMName& iMethodName,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const ContentLanguages & httpContentLanguages,      const ContentLanguageList& httpContentLanguages,
     const Buffer& body,     const Buffer& body,
     Uint32 serverResponseTime,      Uint64 serverResponseTime,
     Boolean isFirst,     Boolean isFirst,
     Boolean isLast)     Boolean isLast)
 { {
Line 2982 
Line 2957 
     const CIMName& cimMethod,     const CIMName& cimMethod,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
     const AcceptLanguages& acceptLanguages,      const AcceptLanguageList& acceptLanguages,
     const ContentLanguages& contentLanguages,      const ContentLanguageList& contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 3053 
Line 3028 
 void XmlWriter::appendEMethodResponseHeader( void XmlWriter::appendEMethodResponseHeader(
     Buffer& out,     Buffer& out,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const ContentLanguages& contentLanguages,      const ContentLanguageList& contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 3221 
Line 3196 
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
     const AcceptLanguages& httpAcceptLanguages,      const AcceptLanguageList& httpAcceptLanguages,
     const ContentLanguages& httpContentLanguages,      const ContentLanguageList& httpContentLanguages,
     const Buffer& body)     const Buffer& body)
 { {
     Buffer out;     Buffer out;
Line 3261 
Line 3236 
     const CIMName& eMethodName,     const CIMName& eMethodName,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const ContentLanguages& httpContentLanguages,      const ContentLanguageList& httpContentLanguages,
     const Buffer& body)     const Buffer& body)
 { {
     Buffer out;     Buffer out;
Line 3442 
Line 3417 
             case XmlEntry::CDATA:             case XmlEntry::CDATA:
             {             {
                 _xmlWritter_indent(os, stack.size(), indentChars);                 _xmlWritter_indent(os, stack.size(), indentChars);
                 os << "<![CDATA[...]]>";                  os << "<![CDATA[" << entry.text << "]]>";
                 break;                 break;
             }             }
  
Line 3465 
Line 3440 
 // //
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
  
   static IDFactory _messageIDFactory(1000);
   
 String XmlWriter::getNextMessageId() String XmlWriter::getNextMessageId()
 { {
     // ATTN: make thread-safe:  
     static Uint32 messageId = 1000;  
   
     messageId++;  
   
     if (messageId < 1000)  
         messageId = 1001;  
   
     char buffer[16];     char buffer[16];
     sprintf(buffer, "%d", messageId);      sprintf(buffer, "%u", _messageIDFactory.getID());
     return buffer;     return buffer;
 } }
  


Legend:
Removed from v.1.128  
changed lines
  Added in v.1.145

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2