summaryrefslogtreecommitdiff
path: root/util/hostandport.h
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2010-04-27 14:22:46 -0400
committerDwight <dmerriman@gmail.com>2010-04-27 14:22:46 -0400
commit4ea1fe91d3656c5b3a185257f95059dfe06b2b6f (patch)
treeb8fd92fd4f13122c841519b15c33b5bcefdd0492 /util/hostandport.h
parenta53f68340b1be33a7e793e904b39897fc82092e9 (diff)
downloadmongo-4ea1fe91d3656c5b3a185257f95059dfe06b2b6f.tar.gz
replsetcnfig work
Diffstat (limited to 'util/hostandport.h')
-rw-r--r--util/hostandport.h4
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):