(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.88 and 1.95

version 1.88, 2003/04/30 18:26:55 version 1.95, 2003/08/26 20:46:28
Line 57 
Line 57 
 #include "XmlParser.h" #include "XmlParser.h"
 #include "Tracer.h" #include "Tracer.h"
 #include <Pegasus/Common/StatisticalData.h> #include <Pegasus/Common/StatisticalData.h>
   #include "CommonUTF.h"
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 108 
Line 109 
     return out;     return out;
 } }
  
   
   // l10n
   Array<Sint8>& operator<<(Array<Sint8>& out, const AcceptLanguages& al)
   {
       XmlWriter::append(out, al.toString ());
       return out;
   }
   
   // l10n
   Array<Sint8>& operator<<(Array<Sint8>& out, const ContentLanguages& cl)
   {
       XmlWriter::append(out, cl.toString ());
       return out;
   }
   
   
 PEGASUS_STD(ostream)& operator<<(PEGASUS_STD(ostream)& os, const CIMDateTime& x) PEGASUS_STD(ostream)& operator<<(PEGASUS_STD(ostream)& os, const CIMDateTime& x)
 { {
     return os << x.toString();     return os << x.toString();
Line 128 
Line 145 
  
 inline void _appendChar(Array<Sint8>& out, const Char16& c) inline void _appendChar(Array<Sint8>& out, const Char16& c)
 { {
     out.append(Sint8(c));      // We need to convert the Char16 to UTF8 then append the UTF8
       // character into the array.
       // NOTE: The UTF8 character could be several bytes long.
       // WARNING: This function will put in replacement character for
       // all characters that have surogate pairs.
       Uint8 str[6];
       memset(str,0x00,sizeof(str));
       Uint8* charIN = (Uint8 *)&c;
   
       const Uint16 *strsrc = (Uint16 *)charIN;
       Uint16 *endsrc = (Uint16 *)&charIN[1];
   
       Uint8 *strtgt = (Uint8 *)str;
       Uint8 *endtgt = (Uint8 *)&str[5];
   
       UTF16toUTF8(&strsrc,
                   endsrc,
                   &strtgt,
                   endtgt);
   
       out.append((Sint8 *)str,trailingBytesForUTF8[Uint32(str[0])]+1);
 } }
  
 inline void _appendSpecialChar(Array<Sint8>& out, const Char16& c) inline void _appendSpecialChar(Array<Sint8>& out, const Char16& c)
 { {
     // ATTN-B: Only UTF-8 handled for now.      if ( ((c < Char16(0x20)) && (c >= Char16(0x00))) || (c == Char16(0x7f)) )
   
     if ( (c < Char16(0x20)) || (c == Char16(0x7f)) )  
     {     {
         char charref[7];         char charref[7];
         sprintf(charref, "&#%u;", (Uint16)c);         sprintf(charref, "&#%u;", (Uint16)c);
Line 166 
Line 201 
                 break;                 break;
  
             default:             default:
                   {
                       // We need to convert the Char16 to UTF8 then append the UTF8
                       // character into the array.
                       // NOTE: The UTF8 character could be several bytes long.
                       // WARNING: This function will put in replacement character for
                       // all characters that have surogate pairs.
                       Uint8 str[6];
                       memset(str,0x00,sizeof(str));
                       Uint8* charIN = (Uint8 *)&c;
   
                       const Uint16 *strsrc = (Uint16 *)charIN;
                       Uint16 *endsrc = (Uint16 *)&charIN[1];
   
                       Uint8 *strtgt = (Uint8 *)str;
                       Uint8 *endtgt = (Uint8 *)&str[5];
   
                       UTF16toUTF8(&strsrc,
                                   endsrc,
                                   &strtgt,
                                   endtgt);
   
                       Uint32 number1 = trailingBytesForUTF8[Uint32(str[0])]+1;
   
                       out.append((Sint8 *)str,number1);
                   }
           }
       }
   }
   
   inline void _appendSpecialChar(Array<Sint8>& out, char c)
   {
       if ( ((c < Char16(0x20)) && (c >= Char16(0x00))) || (c == Char16(0x7f)) )
       {
           char charref[7];
           sprintf(charref, "&#%u;", (Uint8)c);
           out.append(charref, strlen(charref));
       }
       else
       {
           switch (c)
           {
               case '&':
                   out.append("&amp;", 5);
                   break;
   
               case '<':
                   out.append("&lt;", 4);
                   break;
   
               case '>':
                   out.append("&gt;", 4);
                   break;
   
               case '"':
                   out.append("&quot;", 6);
                   break;
   
               case '\'':
                   out.append("&apos;", 6);
                   break;
   
               default:
                 out.append(Sint8(c));                 out.append(Sint8(c));
         }         }
     }     }
 } }
  
   
 static inline void _appendSpecialChar(PEGASUS_STD(ostream)& os, char c) static inline void _appendSpecialChar(PEGASUS_STD(ostream)& os, char c)
 { {
     if ( (c < Char16(0x20)) || (c == Char16(0x7f)) )     if ( (c < Char16(0x20)) || (c == Char16(0x7f)) )
     {     {
         char charref[7];         char charref[7];
         sprintf(charref, "&#%u;", (Uint16)c);          sprintf(charref, "&#%u;", (Uint8)c);
         os << charref;         os << charref;
     }     }
     else     else
Line 209 
Line 307 
     }     }
 } }
  
   void _appendSurrogatePair(Array<Sint8>& out, Uint16 high, Uint16 low)
   {
       Uint8 str[6];
       Uint8 charIN[5];
       memset(str,0x00,sizeof(str));
       memcpy(&charIN,&high,2);
       memcpy(&charIN[2],&low,2);
       const Uint16 *strsrc = (Uint16 *)charIN;
       Uint16 *endsrc = (Uint16 *)&charIN[3];
   
       Uint8 *strtgt = (Uint8 *)str;
       Uint8 *endtgt = (Uint8 *)&str[5];
   
       UTF16toUTF8(&strsrc,
                   endsrc,
                   &strtgt,
                   endtgt);
   
       Uint32 number1 = trailingBytesForUTF8[Uint32(str[0])]+1;
       out.append((Sint8 *)str,number1);
   }
   
 static inline void _appendSpecial(PEGASUS_STD(ostream)& os, const char* str) static inline void _appendSpecial(PEGASUS_STD(ostream)& os, const char* str)
 { {
     while (*str)     while (*str)
Line 271 
Line 391 
 { {
     for (Uint32 i = 0; i < str.size(); i++)     for (Uint32 i = 0; i < str.size(); i++)
     {     {
           Uint16 c = str[i];
           if(((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||
              ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE)))
           {
               Char16 highSurrogate = str[i];
               Char16 lowSurrogate = str[++i];
   
               _appendSurrogatePair(out, Uint16(highSurrogate),Uint16(lowSurrogate));
           }
           else
           {
         _appendChar(out, str[i]);         _appendChar(out, str[i]);
     }     }
 } }
   }
  
 void XmlWriter::append(Array<Sint8>& out, const Indentor& x) void XmlWriter::append(Array<Sint8>& out, const Indentor& x)
 { {
Line 288 
Line 420 
  
 void XmlWriter::appendSpecial(Array<Sint8>& out, char x) void XmlWriter::appendSpecial(Array<Sint8>& out, char x)
 { {
     _appendSpecialChar(out, Char16(x));      _appendSpecialChar(out, x);
 } }
  
 void XmlWriter::appendSpecial(Array<Sint8>& out, const char* str) void XmlWriter::appendSpecial(Array<Sint8>& out, const char* str)
Line 301 
Line 433 
 { {
     for (Uint32 i = 0; i < str.size(); i++)     for (Uint32 i = 0; i < str.size(); i++)
     {     {
           Uint16 c = str[i];
   
           if(((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||
              ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE)))
           {
               Char16 highSurrogate = str[i];
               Char16 lowSurrogate = str[++i];
   
               _appendSurrogatePair(out, Uint16(highSurrogate),Uint16(lowSurrogate));
           }
           else
           {
         _appendSpecialChar(out, str[i]);         _appendSpecialChar(out, str[i]);
     }     }
 } }
   }
   
   // chuck start
  
 // See http://www.ietf.org/rfc/rfc2396.txt section 2 // See http://www.ietf.org/rfc/rfc2396.txt section 2
 // Reserved characters = ';' '/' '?' ':' '@' '&' '=' '+' '$' ',' // Reserved characters = ';' '/' '?' ':' '@' '&' '=' '+' '$' ','
Line 312 
Line 459 
 //   Space character = 0x20 //   Space character = 0x20
 //   Delimiters = '<' '>' '#' '%' '"' //   Delimiters = '<' '>' '#' '%' '"'
 //   Unwise = '{' '}' '|' '\\' '^' '[' ']' '`' //   Unwise = '{' '}' '|' '\\' '^' '[' ']' '`'
 inline void _encodeURIChar(String& outString, Char16 char16)  //
   
   inline void _encodeURIChar(String& outString, Sint8 char8)
 { {
     // ATTN: Handle non-UTF-8 character sets      Uint8 c = (Uint8)char8;
     char c = char16 & 0x007f;  
  
 #ifndef PEGASUS_DO_NOT_IMPLEMENT_URI_ENCODING #ifndef PEGASUS_DO_NOT_IMPLEMENT_URI_ENCODING
     if ( (c <= 0x20) ||                     // Control characters + space char      if ( ((c <= 0x20) && (c >= 0x00)) ||    // Control characters + space char
          ( (c >= 0x22) && (c <= 0x26) ) ||  // '"' '#' '$' '%' '&'          ( (c >= 0x22) && (c <= 0x26) ) ||  // '"' '#' '$' '%' '&'
          (c == 0x2b) ||                     // '+'          (c == 0x2b) ||                     // '+'
          (c == 0x2c) ||                     // ','          (c == 0x2c) ||                     // ','
Line 327 
Line 475 
          ( (c >= 0x5b) && (c <= 0x5e) ) ||  // '[' '\\' ']' '^'          ( (c >= 0x5b) && (c <= 0x5e) ) ||  // '[' '\\' ']' '^'
          (c == 0x60) ||                     // '`'          (c == 0x60) ||                     // '`'
          ( (c >= 0x7b) && (c <= 0x7d) ) ||  // '{' '|' '}'          ( (c >= 0x7b) && (c <= 0x7d) ) ||  // '{' '|' '}'
          (c == 0x7f) )                      // Control character  //       (c == 0x7f) )                      // Control character
            (c >= 0x7f) )                      // Control character or non US-ASCII (UTF-8)
     {     {
         char hexencoding[4];         char hexencoding[4];
  
Line 337 
Line 486 
     else     else
 #endif #endif
     {     {
         outString.append(c);          outString.append((Uint16)c);
     }     }
 } }
  
Line 347 
Line 496 
  
     for (Uint32 i=0; i<uriString.size(); i++)     for (Uint32 i=0; i<uriString.size(); i++)
     {     {
         _encodeURIChar(encodedString, Char16(uriString[i]));          _encodeURIChar(encodedString, uriString[i]);
     }     }
  
     return encodedString;     return encodedString;
Line 357 
Line 506 
 { {
     String encodedString;     String encodedString;
  
   /* i18n remove - did not handle surrogate pairs
     for (Uint32 i=0; i<uriString.size(); i++)     for (Uint32 i=0; i<uriString.size(); i++)
     {     {
         _encodeURIChar(encodedString, uriString[i]);         _encodeURIChar(encodedString, uriString[i]);
     }     }
   */
   
       // See the "CIM Operations over HTTP" spec, section 3.3.2 and
       // 3.3.3, for the treatment of non US-ASCII (UTF-8) chars
   
       // First, convert to UTF-8 (include handling of surrogate pairs)
       Array<Sint8> utf8;
       for (Uint32 i = 0; i < uriString.size(); i++)
       {
           Uint16 c = uriString[i];
   
           if(((c >= FIRST_HIGH_SURROGATE) && (c <= LAST_HIGH_SURROGATE)) ||
              ((c >= FIRST_LOW_SURROGATE) && (c <= LAST_LOW_SURROGATE)))
           {
               Char16 highSurrogate = uriString[i];
               Char16 lowSurrogate = uriString[++i];
   
               _appendSurrogatePair(utf8, Uint16(highSurrogate),Uint16(lowSurrogate));
           }
           else
           {
               _appendChar(utf8, uriString[i]);
           }
       }
   
       // Second, escape the non HTTP-safe chars
       for (Uint32 i=0; i<utf8.size(); i++)
       {
           _encodeURIChar(encodedString, utf8[i]);
       }
  
     return encodedString;     return encodedString;
 } }
Line 379 
Line 559 
 { {
     out << "<LOCALNAMESPACEPATH>\n";     out << "<LOCALNAMESPACEPATH>\n";
  
     char* nameSpaceCopy = strdup(nameSpace.getString().getCString());      char* nameSpaceCopy = strdup(nameSpace.getString().getCStringUTF8());
   #if defined(PEGASUS_PLATFORM_SOLARIS_SPARC_CC) || \
       defined(PEGASUS_OS_HPUX) || \
       defined(PEGASUS_OS_LINUX)
       char *last;
       for (const char* p = strtok_r(nameSpaceCopy, "/", &last); p;
            p = strtok_r(NULL, "/", &last))
   #else
     for (const char* p = strtok(nameSpaceCopy, "/"); p; p = strtok(NULL, "/"))     for (const char* p = strtok(nameSpaceCopy, "/"); p; p = strtok(NULL, "/"))
   #endif
     {     {
         out << "<NAMESPACE NAME=\"" << p << "\"/>\n";         out << "<NAMESPACE NAME=\"" << p << "\"/>\n";
     }     }
Line 1460 
Line 1648 
     }     }
 } }
  
   // l10n - added content language and accept language support to
   // the header methods below
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendMethodCallHeader() // appendMethodCallHeader()
Line 1475 
Line 1666 
     const String& cimObject,     const String& cimObject,
     const String& authenticationHeader,     const String& authenticationHeader,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const AcceptLanguages & acceptLanguages,
       const ContentLanguages & contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 1485 
Line 1678 
     // do that in client today. Permanent change is to retry until spec     // do that in client today. Permanent change is to retry until spec
     // updated. This change is temp to finish tests or until the retry     // updated. This change is temp to finish tests or until the retry
     // installed.  Required because of change to wbemservices cimom     // installed.  Required because of change to wbemservices cimom
 #ifdef PEGASUS_SNIA_INTEROP_TEST  #if defined PEGASUS_SNIA_INTEROP_TEST || defined PEGASUS_FORCE_POST_METHOD
     out << "POST /cimom HTTP/1.1\r\n";     out << "POST /cimom HTTP/1.1\r\n";
 #else #else
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
Line 1500 
Line 1693 
     out << "HOST: " << host << "\r\n";     out << "HOST: " << host << "\r\n";
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (acceptLanguages.size() > 0)
       {
           out << "Accept-Language: " << acceptLanguages << "\r\n";
       }
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
         out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";         out << "Man: http://www.dmtf.org/cim/mapping/http/v1.0; ns=";
Line 1524 
Line 1725 
     out << "\r\n";     out << "\r\n";
 } }
  
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // appendMethodResponseHeader() // appendMethodResponseHeader()
Line 1535 
Line 1737 
 void XmlWriter::appendMethodResponseHeader( void XmlWriter::appendMethodResponseHeader(
     Array<Sint8>& out,     Array<Sint8>& out,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages & contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 1543 
Line 1746 
     STAT_SERVERTIME     STAT_SERVERTIME
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
         out << "Ext:\r\n";         out << "Ext:\r\n";
Line 1630 
Line 1837 
 //    out << "</BODY></HTML>\r\n"; //    out << "</BODY></HTML>\r\n";
 } }
  
   #ifdef PEGASUS_KERBEROS_AUTHENTICATION
   //------------------------------------------------------------------------------
   //
   // appendOKResponseHeader()
   //
   //     Build HTTP authentication response header for unauthorized requests.
   //
   //     Returns OK message in the following format:
   //
   //        HTTP/1.1 200 OK
   //        WWW-Authenticate: Negotiate "token"
   //        <HTML><HEAD>
   //        <TITLE>200 OK</TITLE>
   //        </HEAD><BODY BGCOLOR="#99cc99">
   //        <H2>TEST200 OK</H2>
   //        <HR>
   //        </BODY></HTML>
   //
   //------------------------------------------------------------------------------
   
   void XmlWriter::appendOKResponseHeader(
       Array<Sint8>& out,
       const String& content)
   {
       out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";
       out << content << "\r\n";
       out << "\r\n";
   
   //ATTN: We may need to include the following line, so that the browsers
   //      can display the error message.
   //    out << "<HTML><HEAD>\r\n";
   //    out << "<TITLE>" << "200 OK" <<  "</TITLE>\r\n";
   //    out << "</HEAD><BODY BGCOLOR=\"#99cc99\">\r\n";
   //    out << "<H2>TEST" << "200 OK" << "</H2>\r\n";
   //    out << "<HR>\r\n";
   //    out << "</BODY></HTML>\r\n";
   }
   #endif
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // _appendMessageElementBegin() // _appendMessageElementBegin()
Line 2160 
Line 2406 
     return out;     return out;
 } }
  
   // l10n - add content language support to the format methods below
   
 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
 // //
 // XmlWriter::formatSimpleMethodReqMessage() // XmlWriter::formatSimpleMethodReqMessage()
Line 2175 
Line 2423 
     const Array<CIMParamValue>& parameters,     const Array<CIMParamValue>& parameters,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader)      const String& authenticationHeader,
       const AcceptLanguages& httpAcceptLanguages,
       const ContentLanguages& httpContentLanguages)
 { {
     Array<Sint8> out;     Array<Sint8> out;
     Array<Sint8> tmp;     Array<Sint8> tmp;
Line 2202 
Line 2452 
         localObjectPath.toString(),         localObjectPath.toString(),
         authenticationHeader,         authenticationHeader,
         httpMethod,         httpMethod,
           httpAcceptLanguages,
           httpContentLanguages,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
Line 2212 
Line 2464 
     const CIMName& methodName,     const CIMName& methodName,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages & httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2225 
Line 2478 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, httpMethod, out.size());      appendMethodResponseHeader(tmp,
           httpMethod,
           httpContentLanguages,
           out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2254 
Line 2510 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, httpMethod, out.size());  // l10n
       appendMethodResponseHeader(tmp,
           httpMethod,
           cimException.getContentLanguages(),
           out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2273 
Line 2533 
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
       const AcceptLanguages& httpAcceptLanguages,
       const ContentLanguages& httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2294 
Line 2556 
         nameSpace.getString(),         nameSpace.getString(),
         authenticationHeader,         authenticationHeader,
         httpMethod,         httpMethod,
           httpAcceptLanguages,
           httpContentLanguages,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
Line 2310 
Line 2574 
     const CIMName& iMethodName,     const CIMName& iMethodName,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages & httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2328 
Line 2593 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, httpMethod, out.size());      appendMethodResponseHeader(tmp,
                    httpMethod,
                    httpContentLanguages,
            out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2357 
Line 2625 
     _appendSimpleRspElementEnd(out);     _appendSimpleRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendMethodResponseHeader(tmp, httpMethod, out.size());  // l10n
       appendMethodResponseHeader(tmp,
            httpMethod,
            cimException.getContentLanguages(),
            out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2384 
Line 2656 
     const CIMName& cimMethod,     const CIMName& cimMethod,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
       const AcceptLanguages& acceptLanguages,
       const ContentLanguages& contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 2399 
Line 2673 
     out << "HOST: " << host << "\r\n";     out << "HOST: " << host << "\r\n";
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (acceptLanguages.size() > 0)
       {
           out << "Accept-Language: " << acceptLanguages << "\r\n";
       }
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
         out << "Man: http://www.hp.com; ns=";         out << "Man: http://www.hp.com; ns=";
Line 2430 
Line 2712 
 void XmlWriter::appendEMethodResponseHeader( void XmlWriter::appendEMethodResponseHeader(
     Array<Sint8>& out,     Array<Sint8>& out,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages& contentLanguages,
     Uint32 contentLength)     Uint32 contentLength)
 { {
     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };     char nn[] = { '0' + (rand() % 10), '0' + (rand() % 10), '\0' };
Line 2437 
Line 2720 
     out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";     out << "HTTP/1.1 " HTTP_STATUS_OK "\r\n";
     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";     out << "Content-Type: application/xml; charset=\"utf-8\"\r\n";
     out << "Content-Length: " << contentLength << "\r\n";     out << "Content-Length: " << contentLength << "\r\n";
       if (contentLanguages.size() > 0)
       {
           out << "Content-Language: " << contentLanguages << "\r\n";
       }
     if (httpMethod == HTTP_METHOD_M_POST)     if (httpMethod == HTTP_METHOD_M_POST)
     {     {
         out << "Ext:\r\n";         out << "Ext:\r\n";
Line 2592 
Line 2879 
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
     const String& authenticationHeader,     const String& authenticationHeader,
       const AcceptLanguages& httpAcceptLanguages,
       const ContentLanguages& httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2612 
Line 2901 
         eMethodName,         eMethodName,
         httpMethod,         httpMethod,
         authenticationHeader,         authenticationHeader,
           httpAcceptLanguages,
           httpContentLanguages,
         out.size());         out.size());
     tmp << out;     tmp << out;
  
Line 2628 
Line 2919 
     const CIMName& eMethodName,     const CIMName& eMethodName,
     const String& messageId,     const String& messageId,
     HttpMethod httpMethod,     HttpMethod httpMethod,
       const ContentLanguages& httpContentLanguages,
     const Array<Sint8>& body)     const Array<Sint8>& body)
 { {
     Array<Sint8> out;     Array<Sint8> out;
Line 2641 
Line 2933 
     _appendSimpleExportRspElementEnd(out);     _appendSimpleExportRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendEMethodResponseHeader(tmp, httpMethod, out.size());      appendEMethodResponseHeader(tmp,
           httpMethod,
           httpContentLanguages,
           out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;
Line 2670 
Line 2965 
     _appendSimpleExportRspElementEnd(out);     _appendSimpleExportRspElementEnd(out);
     _appendMessageElementEnd(out);     _appendMessageElementEnd(out);
  
     appendEMethodResponseHeader(tmp, httpMethod, out.size());  // l10n
       appendEMethodResponseHeader(tmp,
            httpMethod,
            cimException.getContentLanguages(),
                    out.size());
     tmp << out;     tmp << out;
  
     return tmp;     return tmp;


Legend:
Removed from v.1.88  
changed lines
  Added in v.1.95

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2