Changeset 43136 in vbox for trunk/src/VBox/Main/webservice
- Timestamp:
- Aug 31, 2012 12:23:58 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 80508
- Location:
- trunk/src/VBox/Main/webservice
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/vboxweb.cpp
r42685 r43136 1437 1437 return aStr.c_str(); 1438 1438 } 1439 1440 void Base64DecodeByteArray(st d::string& aStr, ComSafeArrayOut(BYTE, aData))1439 #define DECODE_STR_MAX 0x100000 1440 void Base64DecodeByteArray(struct soap *soap, std::string& aStr, ComSafeArrayOut(BYTE, aData)) 1441 1441 { 1442 1442 const char* pszStr = aStr.c_str(); 1443 1443 ssize_t cbOut = RTBase64DecodedSize(pszStr, NULL); 1444 1444 1445 Assert(cbOut > 0); 1445 if(cbOut > DECODE_STR_MAX) 1446 { 1447 WebLog("Decode string too long.\n"); 1448 RaiseSoapRuntimeFault(soap, VERR_BUFFER_OVERFLOW, (ComPtr<IUnknown>)NULL); 1449 } 1446 1450 1447 1451 com::SafeArray<BYTE> result(cbOut); 1448 1452 int rc = RTBase64Decode(pszStr, result.raw(), cbOut, NULL, NULL); 1449 AssertRC(rc); 1453 if (FAILED(rc)) 1454 { 1455 WebLog("String Decoding Failed. ERROR: 0x%lX\n", rc); 1456 RaiseSoapRuntimeFault(soap, rc, (ComPtr<IUnknown>)NULL); 1457 } 1450 1458 1451 1459 result.detachTo(ComSafeArrayOutArg(aData)); -
trunk/src/VBox/Main/webservice/vboxweb.h
r40151 r43136 99 99 std::string Base64EncodeByteArray(ComSafeArrayIn(BYTE, aData)); 100 100 101 void Base64DecodeByteArray(st d::string& aStr, ComSafeArrayOut(BYTE, aData));101 void Base64DecodeByteArray(struct soap *soap, std::string& aStr, ComSafeArrayOut(BYTE, aData)); 102 102 /**************************************************************************** 103 103 * -
trunk/src/VBox/Main/webservice/websrv-cpp.xsl
r43103 r43136 547 547 <xsl:value-of select="concat('com::SafeArray<BYTE> comcall_',$name, ';')" /> 548 548 <xsl:call-template name="emitNewlineIndent8" /> 549 <xsl:value-of select="concat('Base64DecodeByteArray( ',$structprefix,$name,', ComSafeArrayAsOutParam(comcall_',$name, '));')" />549 <xsl:value-of select="concat('Base64DecodeByteArray(soap, ',$structprefix,$name,', ComSafeArrayAsOutParam(comcall_',$name, '));')" /> 550 550 </xsl:when> 551 551
Note:
See TracChangeset
for help on using the changeset viewer.