summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2014-06-27 13:49:24 -0400
committerAndy Schwerin <schwerin@mongodb.com>2014-06-30 19:02:35 -0400
commit1a49d864f34812f73c10b8e0b30c15150cb6ca69 (patch)
treed2616c45c978ef14b0e65cfc11a71cee439ee3fe /src/mongo/db
parent7a0d83d88d18d5c28fe13bd5dc0b13d1c6c2ef22 (diff)
downloadmongo-1a49d864f34812f73c10b8e0b30c15150cb6ca69.tar.gz
SERVER-14367 Preparation for removing some implicit conversion and other methods of HostAndPort.
The setPort and implicit conversion operators are going away. This path fixes their existing users.
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/commands/clone_collection.cpp2
-rw-r--r--src/mongo/db/commands/isself.cpp2
-rw-r--r--src/mongo/db/curop.h7
-rw-r--r--src/mongo/db/pipeline/document_source_merge_cursors.cpp2
-rw-r--r--src/mongo/db/repl/connections.h2
-rw-r--r--src/mongo/db/repl/rs_config.cpp2
-rw-r--r--src/mongo/db/repl/rs_rollback.cpp2
7 files changed, 12 insertions, 7 deletions
diff --git a/src/mongo/db/commands/clone_collection.cpp b/src/mongo/db/commands/clone_collection.cpp
index eb63c382f57..c0e7ce576aa 100644
--- a/src/mongo/db/commands/clone_collection.cpp
+++ b/src/mongo/db/commands/clone_collection.cpp
@@ -133,7 +133,7 @@ namespace mongo {
Cloner cloner;
auto_ptr<DBClientConnection> myconn;
myconn.reset( new DBClientConnection() );
- if ( ! myconn->connect( fromhost , errmsg ) )
+ if ( ! myconn->connect( HostAndPort(fromhost) , errmsg ) )
return false;
cloner.setConnection( myconn.release() );
diff --git a/src/mongo/db/commands/isself.cpp b/src/mongo/db/commands/isself.cpp
index 6c91db9dfa2..3c95e2ed2d3 100644
--- a/src/mongo/db/commands/isself.cpp
+++ b/src/mongo/db/commands/isself.cpp
@@ -255,7 +255,7 @@ namespace mongo {
isSelfCommand.init();
DBClientConnection conn;
string errmsg;
- if ( ! conn.connect( host , errmsg ) ) {
+ if ( ! conn.connect( *this , errmsg ) ) {
// should this go in the cache?
return false;
}
diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h
index f24da292c98..9be0af8908c 100644
--- a/src/mongo/db/curop.h
+++ b/src/mongo/db/curop.h
@@ -288,7 +288,12 @@ namespace mongo {
// Fetches less information than "info()"; used to search for ops with certain criteria
BSONObj description();
- std::string getRemoteString( bool includePort = true ) { return _remote.toString(includePort); }
+ std::string getRemoteString( bool includePort = true ) {
+ if (includePort)
+ return _remote.toString();
+ return _remote.host();
+ }
+
ProgressMeter& setMessage(const char * msg,
std::string name = "Progress",
unsigned long long progressMeterTotal = 0,
diff --git a/src/mongo/db/pipeline/document_source_merge_cursors.cpp b/src/mongo/db/pipeline/document_source_merge_cursors.cpp
index 408475f022b..b0c56d2878f 100644
--- a/src/mongo/db/pipeline/document_source_merge_cursors.cpp
+++ b/src/mongo/db/pipeline/document_source_merge_cursors.cpp
@@ -71,7 +71,7 @@ namespace mongo {
massert(17027, string("Expected an Object, but got a ") + typeName(cursor.type()),
cursor.type() == Object);
- cursorIds.push_back(make_pair(ConnectionString(cursor["host"].String()),
+ cursorIds.push_back(make_pair(ConnectionString(HostAndPort(cursor["host"].String())),
cursor["id"].Long()));
}
diff --git a/src/mongo/db/repl/connections.h b/src/mongo/db/repl/connections.h
index 32836b3d4a1..eadf4e92d49 100644
--- a/src/mongo/db/repl/connections.h
+++ b/src/mongo/db/repl/connections.h
@@ -132,7 +132,7 @@ namespace repl {
// we should already be locked...
bool connect() {
std::string err;
- if (!connInfo->cc->connect(_hostport, err)) {
+ if (!connInfo->cc->connect(HostAndPort(_hostport), err)) {
log() << "couldn't connect to " << _hostport << ": " << err << rsLog;
return false;
}
diff --git a/src/mongo/db/repl/rs_config.cpp b/src/mongo/db/repl/rs_config.cpp
index f76778ed821..a064289ab86 100644
--- a/src/mongo/db/repl/rs_config.cpp
+++ b/src/mongo/db/repl/rs_config.cpp
@@ -508,7 +508,7 @@ namespace {
m.h = HostAndPort(s);
if ( !m.h.hasPort() ) {
// make port explicit even if default
- m.h.setPort(m.h.port());
+ m.h = HostAndPort(m.h.host(), m.h.port());
}
}
catch (const DBException& e) {
diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp
index 985d751aa8e..3cead0d5d9e 100644
--- a/src/mongo/db/repl/rs_rollback.cpp
+++ b/src/mongo/db/repl/rs_rollback.cpp
@@ -352,7 +352,7 @@ namespace repl {
// cloner owns _conn in auto_ptr
cloner.setConnection(tmpConn);
uassert(15908, errmsg,
- tmpConn->connect(host, errmsg) && repl::replAuthenticate(tmpConn));
+ tmpConn->connect(HostAndPort(host), errmsg) && repl::replAuthenticate(tmpConn));
return cloner.copyCollection(txn, ns, BSONObj(), errmsg, true, false, true, false);
}