restoreBackup client changes; part of #2183
This commit is contained in:
parent
ce9518d23c
commit
eadf37505c
|
@ -756,7 +756,7 @@ const std::string restoreBackupSessionIdParamName = "sessid";
|
|||
/*------------------------------------------------------------------------------
|
||||
* The name of the file name parameter in the input structure
|
||||
*----------------------------------------------------------------------------*/
|
||||
const std::string restoreBackupFileNameParamName = "filename";
|
||||
const std::string restoreBackupChecksumParamName = "chsum";
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The name of the URL parameter in the input or output structure
|
||||
|
@ -2524,14 +2524,22 @@ WebStorageClient :: restoreBackupOpen(
|
|||
Ptr<const Glib::ustring>::Ref path) const
|
||||
throw (XmlRpcException)
|
||||
{
|
||||
std::ifstream ifs(path->c_str());
|
||||
if (!ifs) {
|
||||
ifs.close();
|
||||
throw XmlRpcIOException("Could not read the playlist archive file.");
|
||||
}
|
||||
std::string md5string = Md5(ifs);
|
||||
ifs.close();
|
||||
|
||||
XmlRpcValue parameters;
|
||||
XmlRpcValue result;
|
||||
|
||||
parameters.clear();
|
||||
parameters[restoreBackupSessionIdParamName]
|
||||
= sessionId->getId();
|
||||
parameters[restoreBackupFileNameParamName]
|
||||
= std::string(*path);
|
||||
parameters[restoreBackupChecksumParamName]
|
||||
= md5string;
|
||||
|
||||
execute(restoreBackupOpenMethodName, parameters, result);
|
||||
|
||||
|
|
|
@ -256,6 +256,7 @@ RestoreBackupWindow :: restoreBackupClose(void) throw ()
|
|||
|
||||
try {
|
||||
storage->restoreBackupClose(*token);
|
||||
token.reset();
|
||||
|
||||
} catch (XmlRpcException &e) {
|
||||
signalError(e.what());
|
||||
|
|
Loading…
Reference in New Issue