fixed the C++ wrapper of the resetStorage method in the storage server

This commit is contained in:
fgerlits 2005-01-19 11:39:20 +00:00
parent d2a971ad45
commit 575e1a56ab
2 changed files with 16 additions and 8 deletions

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.9 $ Version : $Revision: 1.10 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/authentication/src/WebAuthenticationClient.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/authentication/src/WebAuthenticationClient.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -173,9 +173,14 @@ static const std::string preferencesStatusParamName = "status";
static const std::string resetStorageMethodName = "locstor.resetStorage"; static const std::string resetStorageMethodName = "locstor.resetStorage";
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
* The name of the result parameter returned by the method (ignored here) * The name of the list of audio clips parameter returned (ignored here)
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
static const std::string resetStorageResultParamName = "gunids"; static const std::string resetStorageAudioClipResultParamName = "audioclips";
/*------------------------------------------------------------------------------
* The name of the list of playlists parameter returned (ignored here)
*----------------------------------------------------------------------------*/
static const std::string resetStoragePlaylistResultParamName = "playlists";
/* =============================================== local function prototypes */ /* =============================================== local function prototypes */
@ -552,15 +557,18 @@ WebAuthenticationClient :: reset(void)
throw Core::XmlRpcMethodFaultException(eMsg.str()); throw Core::XmlRpcMethodFaultException(eMsg.str());
} }
if (! result.hasMember(resetStorageResultParamName) if (! result.hasMember(resetStorageAudioClipResultParamName)
|| result[resetStorageResultParamName].getType() || result[resetStorageAudioClipResultParamName].getType()
!= XmlRpcValue::TypeArray
|| ! result.hasMember(resetStoragePlaylistResultParamName)
|| result[resetStoragePlaylistResultParamName].getType()
!= XmlRpcValue::TypeArray) { != XmlRpcValue::TypeArray) {
std::stringstream eMsg; std::stringstream eMsg;
eMsg << "XML-RPC method '" eMsg << "XML-RPC method '"
<< resetStorageMethodName << resetStorageMethodName
<< "' returned unexpected value:\n" << "' returned unexpected value:\n"
<< result; << result;
throw Core::XmlRpcMethodResponseException(eMsg.str()); throw XmlRpcMethodResponseException(eMsg.str());
} }
} }

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.28 $ Version : $Revision: 1.29 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -1886,7 +1886,7 @@ WebStorageClient :: reset(void)
for (int i=0; i < playlistArray.size(); i++) { for (int i=0; i < playlistArray.size(); i++) {
if (playlistArray[i].getType() != XmlRpcValue::TypeString) { if (playlistArray[i].getType() != XmlRpcValue::TypeString) {
std::stringstream eMsg; std::stringstream eMsg;
eMsg << "Non-string audio clip gunid returned by XML-RPC method '" eMsg << "Non-string playlist gunid returned by XML-RPC method '"
<< resetStorageMethodName << resetStorageMethodName
<< "':\n" << "':\n"
<< result; << result;