summaryrefslogtreecommitdiff
path: root/lib/backupstore
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2013-08-21 01:00:23 +0000
committerChris Wilson <chris+github@qwirx.com>2013-08-21 01:00:23 +0000
commit12b7c9b8eac173e326b63a71c890229cd39920e8 (patch)
treebc7956f675ec3448f7eca13ce81aa7369053a85d /lib/backupstore
parent9662290600dd0a9fac3626ca07da0cb8c40e62b0 (diff)
Allow getting the name of the current phase of a BackupStoreContext.
Useful for debugging when the phase is not as expected.
Diffstat (limited to 'lib/backupstore')
-rw-r--r--lib/backupstore/BackupStoreContext.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/backupstore/BackupStoreContext.h b/lib/backupstore/BackupStoreContext.h
index c2fe14ff..c33e7d50 100644
--- a/lib/backupstore/BackupStoreContext.h
+++ b/lib/backupstore/BackupStoreContext.h
@@ -66,6 +66,19 @@ public:
};
int GetPhase() const {return mProtocolPhase;}
+ std::string GetPhaseName() const
+ {
+ switch(mProtocolPhase)
+ {
+ case Phase_Version: return "Phase_Version";
+ case Phase_Login: return "Phase_Login";
+ case Phase_Commands: return "Phase_Commands";
+ default:
+ std::ostringstream oss;
+ oss << "Unknown phase " << mProtocolPhase;
+ return oss.str();
+ }
+ }
void SetPhase(int NewPhase) {mProtocolPhase = NewPhase;}
// Read only locking