From dea24ce69f88e2e28dce35aacaba83c90adb6cff Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 13 Dec 2011 00:43:41 +0000 Subject: Add remote host and port to post-login login message, requested by Pete Jalajas. --- lib/backupstore/BackupCommands.cpp | 3 ++- lib/backupstore/BackupStoreContext.cpp | 5 +++-- lib/backupstore/BackupStoreContext.h | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/backupstore') diff --git a/lib/backupstore/BackupCommands.cpp b/lib/backupstore/BackupCommands.cpp index b2a42eb7..66764a3b 100644 --- a/lib/backupstore/BackupCommands.cpp +++ b/lib/backupstore/BackupCommands.cpp @@ -131,7 +131,8 @@ std::auto_ptr BackupProtocolLogin::DoCommand(BackupProtoc BOX_FORMAT_ACCOUNT(mClientID) << " " "(name=" << rContext.GetAccountName() << "): " << (((mFlags & Flags_ReadOnly) != Flags_ReadOnly) - ?"Read/Write":"Read-only")); + ?"Read/Write":"Read-only") << " from " << + rContext.GetConnectionDetails()); // Get the usage info for reporting to the client int64_t blocksUsed = 0, blocksSoftLimit = 0, blocksHardLimit = 0; diff --git a/lib/backupstore/BackupStoreContext.cpp b/lib/backupstore/BackupStoreContext.cpp index e44fa29d..2c98b1d7 100644 --- a/lib/backupstore/BackupStoreContext.cpp +++ b/lib/backupstore/BackupStoreContext.cpp @@ -54,8 +54,9 @@ // // -------------------------------------------------------------------------- BackupStoreContext::BackupStoreContext(int32_t ClientID, - HousekeepingInterface &rDaemon) - : mClientID(ClientID), + HousekeepingInterface &rDaemon, const std::string& rConnectionDetails) + : mConnectionDetails(rConnectionDetails), + mClientID(ClientID), mrDaemon(rDaemon), mProtocolPhase(Phase_START), mClientHasAccount(false), diff --git a/lib/backupstore/BackupStoreContext.h b/lib/backupstore/BackupStoreContext.h index 7388f753..c2fe14ff 100644 --- a/lib/backupstore/BackupStoreContext.h +++ b/lib/backupstore/BackupStoreContext.h @@ -45,7 +45,8 @@ class HousekeepingInterface class BackupStoreContext { public: - BackupStoreContext(int32_t ClientID, HousekeepingInterface &rDaemon); + BackupStoreContext(int32_t ClientID, HousekeepingInterface &rDaemon, + const std::string& rConnectionDetails); ~BackupStoreContext(); private: BackupStoreContext(const BackupStoreContext &rToCopy); @@ -137,6 +138,7 @@ public: // Info int32_t GetClientID() const {return mClientID;} + const std::string& GetConnectionDetails() { return mConnectionDetails; } private: void MakeObjectFilename(int64_t ObjectID, std::string &rOutput, bool EnsureDirectoryExists = false); @@ -146,6 +148,7 @@ private: void DeleteDirectoryRecurse(int64_t ObjectID, int64_t &rBlocksDeletedOut, bool Undelete); int64_t AllocateObjectID(); + std::string mConnectionDetails; int32_t mClientID; HousekeepingInterface &mrDaemon; int mProtocolPhase; -- cgit v1.2.3