summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/scoped_conn.cpp
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-07-28 18:16:39 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-07-28 18:27:27 -0400
commitb66e993f1c742518d9b5e93b0d8a5f8255a4127c (patch)
tree55e6fed05333d2d37f34586726a342ed7f7dbc29 /src/mongo/db/repl/scoped_conn.cpp
parent314a22e93f283ab80e650618cbd3ed8babb8510f (diff)
downloadmongo-b66e993f1c742518d9b5e93b0d8a5f8255a4127c.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/repl/scoped_conn.cpp')
-rw-r--r--src/mongo/db/repl/scoped_conn.cpp65
1 files changed, 33 insertions, 32 deletions
diff --git a/src/mongo/db/repl/scoped_conn.cpp b/src/mongo/db/repl/scoped_conn.cpp
index e4116fcf584..113261733da 100644
--- a/src/mongo/db/repl/scoped_conn.cpp
+++ b/src/mongo/db/repl/scoped_conn.cpp
@@ -39,41 +39,42 @@
namespace mongo {
namespace repl {
- static const int DEFAULT_HEARTBEAT_TIMEOUT_SECS = 10;
+static const int DEFAULT_HEARTBEAT_TIMEOUT_SECS = 10;
- // This is a bitmask with the first bit set. It's used to mark connections that should be kept
- // open during stepdowns
- const unsigned ScopedConn::keepOpen = 1;
- ScopedConn::M& ScopedConn::_map = *(new ScopedConn::M());
- mutex ScopedConn::mapMutex("ScopedConn::mapMutex");
+// This is a bitmask with the first bit set. It's used to mark connections that should be kept
+// open during stepdowns
+const unsigned ScopedConn::keepOpen = 1;
+ScopedConn::M& ScopedConn::_map = *(new ScopedConn::M());
+mutex ScopedConn::mapMutex("ScopedConn::mapMutex");
- ScopedConn::ConnectionInfo::ConnectionInfo() : lock("ConnectionInfo"),
- cc(new DBClientConnection(/*reconnect*/ true,
- /*timeout*/ DEFAULT_HEARTBEAT_TIMEOUT_SECS)),
- connected(false) {
- cc->_logLevel = logger::LogSeverity::Debug(2);
- }
+ScopedConn::ConnectionInfo::ConnectionInfo()
+ : lock("ConnectionInfo"),
+ cc(new DBClientConnection(/*reconnect*/ true,
+ /*timeout*/ DEFAULT_HEARTBEAT_TIMEOUT_SECS)),
+ connected(false) {
+ cc->_logLevel = logger::LogSeverity::Debug(2);
+}
- // we should already be locked...
- bool ScopedConn::connect() {
- std::string err;
- if (!connInfo->cc->connect(HostAndPort(_hostport), err)) {
- log() << "couldn't connect to " << _hostport << ": " << err;
- return false;
- }
- connInfo->connected = true;
- connInfo->tagPort();
-
- // if we cannot authenticate against a member, then either its key file
- // or our key file has to change. if our key file has to change, we'll
- // be rebooting. if their file has to change, they'll be rebooted so the
- // connection created above will go dead, reconnect, and reauth.
- if (getGlobalAuthorizationManager()->isAuthEnabled()) {
- return authenticateInternalUser(connInfo->cc.get());
- }
+// we should already be locked...
+bool ScopedConn::connect() {
+ std::string err;
+ if (!connInfo->cc->connect(HostAndPort(_hostport), err)) {
+ log() << "couldn't connect to " << _hostport << ": " << err;
+ return false;
+ }
+ connInfo->connected = true;
+ connInfo->tagPort();
- return true;
+ // if we cannot authenticate against a member, then either its key file
+ // or our key file has to change. if our key file has to change, we'll
+ // be rebooting. if their file has to change, they'll be rebooted so the
+ // connection created above will go dead, reconnect, and reauth.
+ if (getGlobalAuthorizationManager()->isAuthEnabled()) {
+ return authenticateInternalUser(connInfo->cc.get());
}
-} // namespace repl
-} // namespace mongo
+ return true;
+}
+
+} // namespace repl
+} // namespace mongo