summaryrefslogtreecommitdiff
path: root/bin/bbstored
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bbstored')
-rw-r--r--bin/bbstored/BackupStoreDaemon.cpp14
-rw-r--r--bin/bbstored/BackupStoreDaemon.h3
2 files changed, 11 insertions, 6 deletions
diff --git a/bin/bbstored/BackupStoreDaemon.cpp b/bin/bbstored/BackupStoreDaemon.cpp
index 2bf0073c..71976e6e 100644
--- a/bin/bbstored/BackupStoreDaemon.cpp
+++ b/bin/bbstored/BackupStoreDaemon.cpp
@@ -317,6 +317,8 @@ void BackupStoreDaemon::Connection2(SocketStreamTLS &rStream)
if(::sscanf(clientCommonName.c_str(), "BACKUP-%x", &id) != 1)
{
// Bad! Disconnect immediately
+ BOX_WARNING("Failed login: invalid client common name: " <<
+ clientCommonName);
return;
}
@@ -353,18 +355,20 @@ void BackupStoreDaemon::Connection2(SocketStreamTLS &rStream)
}
catch(...)
{
- LogConnectionStats(clientCommonName.c_str(), rStream);
+ LogConnectionStats(id, context.GetAccountName(), rStream);
throw;
}
- LogConnectionStats(clientCommonName.c_str(), rStream);
+ LogConnectionStats(id, context.GetAccountName(), rStream);
context.CleanUp();
}
-void BackupStoreDaemon::LogConnectionStats(const char *commonName,
- const SocketStreamTLS &s)
+void BackupStoreDaemon::LogConnectionStats(uint32_t accountId,
+ const std::string& accountName, const SocketStreamTLS &s)
{
// Log the amount of data transferred
- BOX_NOTICE("Connection statistics for " << commonName << ":"
+ BOX_NOTICE("Connection statistics for " <<
+ BOX_FORMAT_ACCOUNT(accountId) << " "
+ "(name=" << accountName << "):"
" IN=" << s.GetBytesRead() <<
" OUT=" << s.GetBytesWritten() <<
" NET_IN=" << (s.GetBytesRead() - s.GetBytesWritten()) <<
diff --git a/bin/bbstored/BackupStoreDaemon.h b/bin/bbstored/BackupStoreDaemon.h
index 49af5b81..d86e9dc4 100644
--- a/bin/bbstored/BackupStoreDaemon.h
+++ b/bin/bbstored/BackupStoreDaemon.h
@@ -63,7 +63,8 @@ protected:
// Housekeeping functions
void HousekeepingProcess();
- void LogConnectionStats(const char *commonName, const SocketStreamTLS &s);
+ void LogConnectionStats(uint32_t accountId,
+ const std::string& accountName, const SocketStreamTLS &s);
public:
// HousekeepingInterface implementation