Skip to content

Commit

Permalink
Remove BackupStoreContext::ReceivedFinishCommand
Browse files Browse the repository at this point in the history
Replace with CleanUp(). We don't need two methods that do almost the same
thing.
  • Loading branch information
qris committed Aug 4, 2017
1 parent e59336b commit ea8bb14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/backupstore/BackupCommands.cpp
Expand Up @@ -226,7 +226,7 @@ std::auto_ptr<BackupProtocolMessage> BackupProtocolFinished::DoCommand(BackupPro
"(name=" << rContext.GetAccountName() << ")");

// Let the context know about it
rContext.ReceivedFinishCommand();
rContext.CleanUp();

return std::auto_ptr<BackupProtocolMessage>(new BackupProtocolFinished);
}
Expand Down
21 changes: 3 additions & 18 deletions lib/backupstore/BackupStoreContext.cpp
Expand Up @@ -66,7 +66,7 @@ BackupStoreContext::BackupStoreContext(int32_t ClientID,
mSaveStoreInfoDelay(STORE_INFO_SAVE_DELAY),
mpTestHook(NULL)
// If you change the initialisers, be sure to update
// BackupStoreContext::ReceivedFinishCommand as well!
// BackupStoreContext::CleanUp as well!
{
}

Expand Down Expand Up @@ -110,28 +110,13 @@ void BackupStoreContext::CleanUp()
// Make sure the store info is saved, if it has been loaded, isn't read only and has been modified
if(mapStoreInfo.get() && !(mapStoreInfo->IsReadOnly()) &&
mapStoreInfo->IsModified())
{
mapStoreInfo->Save();
}
}


// --------------------------------------------------------------------------
//
// Function
// Name: BackupStoreContext::ReceivedFinishCommand()
// Purpose: Called when the finish command is received by the protocol
// Created: 16/12/03
//
// --------------------------------------------------------------------------
void BackupStoreContext::ReceivedFinishCommand()
{
if(!mReadOnly && mapStoreInfo.get())
{
// Save the store info, not delayed
SaveStoreInfo(false);
}

ReleaseWriteLock();

// Just in case someone wants to reuse a local protocol object,
// put the context back to its initial state.
mProtocolPhase = BackupStoreContext::Phase_Version;
Expand Down
2 changes: 0 additions & 2 deletions lib/backupstore/BackupStoreContext.h
Expand Up @@ -54,8 +54,6 @@ class BackupStoreContext
BackupStoreContext(const BackupStoreContext &rToCopy); // no copying

public:

void ReceivedFinishCommand();
void CleanUp();
int32_t GetClientID() {return mClientID;}

Expand Down

0 comments on commit ea8bb14

Please sign in to comment.