diff options
Diffstat (limited to 'db/repl.h')
-rw-r--r-- | db/repl.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/db/repl.h b/db/repl.h index f4d0ebedb81..541d4e4d36b 100644 --- a/db/repl.h +++ b/db/repl.h @@ -103,7 +103,8 @@ class ReplSource { public: bool paired; // --pair in use string hostName; // ip addr or hostname plus optionally, ":<port>" - string sourceName; // a logical source name. + string _sourceName; // a logical source name. + string sourceName() const { return _sourceName.empty() ? "main" : _sourceName; } string only; // only a certain db. note that in the sources collection, this may not be changed once you start replicating. /* the last time point we have already synced up to. */ @@ -132,7 +133,7 @@ public: JSObj jsobj(); bool operator==(const ReplSource&r) const { - return hostName == r.hostName && sourceName == r.sourceName; + return hostName == r.hostName && sourceName() == r.sourceName(); } }; |