diff options
author | Dwight <dmerriman@gmail.com> | 2010-04-27 14:22:46 -0400 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2010-04-27 14:22:46 -0400 |
commit | 4ea1fe91d3656c5b3a185257f95059dfe06b2b6f (patch) | |
tree | b8fd92fd4f13122c841519b15c33b5bcefdd0492 /util/hostandport.h | |
parent | a53f68340b1be33a7e793e904b39897fc82092e9 (diff) | |
download | mongo-4ea1fe91d3656c5b3a185257f95059dfe06b2b6f.tar.gz |
replsetcnfig work
Diffstat (limited to 'util/hostandport.h')
-rw-r--r-- | util/hostandport.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/hostandport.h b/util/hostandport.h index 03473ca300f..6e3e8e86e9b 100644 --- a/util/hostandport.h +++ b/util/hostandport.h @@ -44,7 +44,7 @@ namespace mongo { return HostAndPort(string(p,colon-p),port); } // no port specified. - return HostAndPort(p, cmdLine.port); + return HostAndPort(p); } bool operator<(const HostAndPort& r) const { return _host < r._host || (_host==r._host&&_port<r._port); } @@ -58,7 +58,7 @@ namespace mongo { string toString() const; string host() const { return _host; } - int port() const { return _port; } + int port() const { return _port >= 0 ? _port : cmdLine.port; } private: // invariant (except full obj assignment): |