version 1.127.2.1, 2011/01/15 21:26:58
|
version 1.127.2.2, 2011/10/11 18:18:27
|
|
|
// | // |
// M-POST /cimom HTTP/1.1 | // M-POST /cimom HTTP/1.1 |
// HOST: www.erewhon.com | // HOST: www.erewhon.com |
// Content-Type: application/xml; charset="utf-8" |
// Content-Type: application/xml; charset=utf-8 |
// Content-Length: xxxx | // Content-Length: xxxx |
// Man: http://www.dmtf.org/cim/operation ; ns=73 | // Man: http://www.dmtf.org/cim/operation ; ns=73 |
// 73-CIMOperation: MethodCall | // 73-CIMOperation: MethodCall |
|
|
} | } |
} | } |
| |
// Calculate the beginning of the content from the message size and |
|
// the content length. |
|
|
|
content = (char*) httpMessage->message.getData() + |
|
httpMessage->message.size() - contentLength; |
|
|
|
// Validate the "Content-Type" header: | // Validate the "Content-Type" header: |
| |
const char* cimContentType; | const char* cimContentType; |
|
|
(((!String::equalNoCase(type, "application/xml") && | (((!String::equalNoCase(type, "application/xml") && |
!String::equalNoCase(type, "text/xml")) || | !String::equalNoCase(type, "text/xml")) || |
!String::equalNoCase(charset, "utf-8")) | !String::equalNoCase(charset, "utf-8")) |
#if defined(PEGASUS_ENABLE_PROTOCOL_BINARY) |
|
&& !(binaryRequest = String::equalNoCase(type, | && !(binaryRequest = String::equalNoCase(type, |
"application/x-openpegasus")) | "application/x-openpegasus")) |
#endif |
|
)) | )) |
{ | { |
MessageLoaderParms parms( | MessageLoaderParms parms( |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return; | return; |
} | } |
|
// Calculate the beginning of the content from the message size and |
|
// the content length. |
|
if (binaryRequest) |
|
{ |
|
// binary the "Content" also contains a few padding '\0' to align |
|
// data structures to 8byte boundary |
|
// the padding '\0' are also part of the counted contentLength |
|
Uint32 headerEnd = httpMessage->message.size() - contentLength; |
|
Uint32 binContentStart = CIMBuffer::round(headerEnd); |
|
|
|
contentLength = contentLength - (binContentStart - headerEnd); |
|
content = (char*) httpMessage->message.getData() + binContentStart; |
|
} |
|
else |
|
{ |
|
content = (char*) httpMessage->message.getData() + |
|
httpMessage->message.size() - contentLength; |
|
} |
|
|
// Validating content falls within UTF8 | // Validating content falls within UTF8 |
// (required to be complaint with section C12 of Unicode 4.0 spec, | // (required to be complaint with section C12 of Unicode 4.0 spec, |
// chapter 3.) | // chapter 3.) |
else if (!binaryRequest) |
if (!binaryRequest) |
{ | { |
Uint32 count = 0; | Uint32 count = 0; |
while(count<contentLength) | while(count<contentLength) |
|
|
{ | { |
binaryResponse = false; | binaryResponse = false; |
} | } |
|
httpMessage->binaryResponse=binaryResponse; |
| |
// If it is a method call, then dispatch it to be handled: | // If it is a method call, then dispatch it to be handled: |
| |
|
|
| |
if (binaryRequest) | if (binaryRequest) |
{ | { |
Buffer buf(content, contentLength); |
CIMBuffer buf(content, contentLength); |
|
CIMBufferReleaser buf_(buf); |
| |
request.reset(BinaryCodec::decodeRequest(buf, queueId, _returnQueueId)); | request.reset(BinaryCodec::decodeRequest(buf, queueId, _returnQueueId)); |
| |
|
|
{ | { |
Array<String> propertyListArray; | Array<String> propertyListArray; |
pl.get(propertyListArray); | pl.get(propertyListArray); |
Array<CIMName> cimNameArray; |
propertyList.append(propertyListArray); |
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} | } |
} | } |
duplicateParameter = gotPropertyList; | duplicateParameter = gotPropertyList; |
|
|
{ | { |
Array<String> propertyListArray; | Array<String> propertyListArray; |
pl.get(propertyListArray); | pl.get(propertyListArray); |
Array<CIMName> cimNameArray; |
propertyList.append(propertyListArray); |
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} | } |
} | } |
duplicateParameter = gotPropertyList; | duplicateParameter = gotPropertyList; |
|
|
{ | { |
Array<String> propertyListArray; | Array<String> propertyListArray; |
pl.get(propertyListArray); | pl.get(propertyListArray); |
Array<CIMName> cimNameArray; |
propertyList.append(propertyListArray); |
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} | } |
} | } |
duplicateParameter = gotPropertyList; | duplicateParameter = gotPropertyList; |
|
|
{ | { |
Array<String> propertyListArray; | Array<String> propertyListArray; |
pl.get(propertyListArray); | pl.get(propertyListArray); |
Array<CIMName> cimNameArray; |
propertyList.append(propertyListArray); |
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} | } |
} | } |
duplicateParameter = gotPropertyList; | duplicateParameter = gotPropertyList; |