summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2014-06-27 14:31:29 -0400
committerAndy Schwerin <schwerin@mongodb.com>2014-06-27 15:15:27 -0400
commitcf9d8c3ff9733686326fa2a96cd654cd8be3818a (patch)
tree0d3b83613b810d71560605ab6f84e7b8497cdc07 /src/mongo
parent207c8850f59a5f3ad113211167ad6844761ea264 (diff)
downloadmongo-cf9d8c3ff9733686326fa2a96cd654cd8be3818a.tar.gz
SERVER-14374 Include server_options.h as needed and apply the std:: namespace when missing.
Previously, the affected files compiled because of indirect includes from hostandport.h
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/client/replica_set_monitor.cpp4
-rw-r--r--src/mongo/client/replica_set_monitor.h3
-rw-r--r--src/mongo/client/scoped_db_conn_test.cpp1
-rw-r--r--src/mongo/db/auth/security_key.cpp3
-rw-r--r--src/mongo/db/dbmessage.h1
-rw-r--r--src/mongo/db/initialize_server_global_state.cpp1
-rw-r--r--src/mongo/db/repl/member.h4
-rw-r--r--src/mongo/db/repl/repl_set_seed_list.cpp6
-rw-r--r--src/mongo/db/repl/repl_set_seed_list.h9
-rw-r--r--src/mongo/db/repl/rs_config.h1
-rw-r--r--src/mongo/db/write_concern.cpp1
-rw-r--r--src/mongo/s/distlock.cpp1
-rw-r--r--src/mongo/util/net/listen.cpp6
-rw-r--r--src/mongo/util/net/message_port.cpp18
-rw-r--r--src/mongo/util/net/message_server_port.cpp1
-rw-r--r--src/mongo/util/net/sock.cpp1
16 files changed, 40 insertions, 21 deletions
diff --git a/src/mongo/client/replica_set_monitor.cpp b/src/mongo/client/replica_set_monitor.cpp
index 40b3aa2e49e..12635aeaa9d 100644
--- a/src/mongo/client/replica_set_monitor.cpp
+++ b/src/mongo/client/replica_set_monitor.cpp
@@ -31,6 +31,7 @@
#include <boost/thread.hpp>
#include <limits>
+#include "mongo/db/server_options.h"
#include "mongo/client/connpool.h"
#include "mongo/client/replica_set_monitor_internal.h"
#include "mongo/util/concurrency/mutex.h" // for StaticObserver
@@ -356,7 +357,8 @@ namespace {
replicaSetMonitorWatcher.safeGo();
}
- ReplicaSetMonitorPtr ReplicaSetMonitor::get(const string& name, const bool createFromSeed) {
+ ReplicaSetMonitorPtr ReplicaSetMonitor::get(const std::string& name,
+ const bool createFromSeed) {
LOG(3) << "ReplicaSetMonitor::get " << name;
scoped_lock lk( setsLock );
StringMap<ReplicaSetMonitorPtr>::const_iterator i = sets.find( name );
diff --git a/src/mongo/client/replica_set_monitor.h b/src/mongo/client/replica_set_monitor.h
index 3e289b9c65c..225aa749555 100644
--- a/src/mongo/client/replica_set_monitor.h
+++ b/src/mongo/client/replica_set_monitor.h
@@ -37,10 +37,11 @@
#include "mongo/util/net/hostandport.h"
namespace mongo {
+ class BSONObj;
class ReplicaSetMonitor;
class TagSet;
struct ReadPreferenceSetting;
- typedef shared_ptr<ReplicaSetMonitor> ReplicaSetMonitorPtr;
+ typedef boost::shared_ptr<ReplicaSetMonitor> ReplicaSetMonitorPtr;
/**
* Holds state about a replica set and provides a means to refresh the local view.
diff --git a/src/mongo/client/scoped_db_conn_test.cpp b/src/mongo/client/scoped_db_conn_test.cpp
index fb90735b1cb..22126b38360 100644
--- a/src/mongo/client/scoped_db_conn_test.cpp
+++ b/src/mongo/client/scoped_db_conn_test.cpp
@@ -28,6 +28,7 @@
#include "mongo/base/init.h"
#include "mongo/client/connpool.h"
#include "mongo/platform/cstdint.h"
+#include "mongo/util/net/listen.h"
#include "mongo/util/net/message_port.h"
#include "mongo/util/net/message_server.h"
#include "mongo/util/fail_point_service.h"
diff --git a/src/mongo/db/auth/security_key.cpp b/src/mongo/db/auth/security_key.cpp
index c3ff4c2336d..efbe3bdb201 100644
--- a/src/mongo/db/auth/security_key.cpp
+++ b/src/mongo/db/auth/security_key.cpp
@@ -32,12 +32,13 @@
#include <string>
#include <vector>
+#include "mongo/client/sasl_client_authenticate.h"
#include "mongo/db/auth/action_set.h"
#include "mongo/db/auth/action_type.h"
#include "mongo/db/auth/authorization_manager.h"
#include "mongo/db/auth/privilege.h"
#include "mongo/db/auth/user.h"
-#include "mongo/client/sasl_client_authenticate.h"
+#include "mongo/db/server_options.h"
#include "mongo/util/password_digest.h"
namespace mongo {
diff --git a/src/mongo/db/dbmessage.h b/src/mongo/db/dbmessage.h
index cc3df6cd787..621624dd9be 100644
--- a/src/mongo/db/dbmessage.h
+++ b/src/mongo/db/dbmessage.h
@@ -33,6 +33,7 @@
#include "mongo/bson/bson_validate.h"
#include "mongo/client/constants.h"
#include "mongo/db/jsobj.h"
+#include "mongo/db/server_options.h"
#include "mongo/util/net/message.h"
#include "mongo/util/net/message_port.h"
diff --git a/src/mongo/db/initialize_server_global_state.cpp b/src/mongo/db/initialize_server_global_state.cpp
index df9f77fdb2e..02b22defcf9 100644
--- a/src/mongo/db/initialize_server_global_state.cpp
+++ b/src/mongo/db/initialize_server_global_state.cpp
@@ -44,6 +44,7 @@
#include "mongo/db/auth/authorization_manager.h"
#include "mongo/db/auth/authorization_manager_global.h"
#include "mongo/db/auth/security_key.h"
+#include "mongo/db/server_options.h"
#include "mongo/logger/logger.h"
#include "mongo/logger/console_appender.h"
#include "mongo/logger/message_event.h"
diff --git a/src/mongo/db/repl/member.h b/src/mongo/db/repl/member.h
index 76c958c6456..d845471a4a1 100644
--- a/src/mongo/db/repl/member.h
+++ b/src/mongo/db/repl/member.h
@@ -28,6 +28,8 @@
#pragma once
+#include <sstream>
+
#include "mongo/db/repl/heartbeat_info.h"
#include "mongo/db/repl/rs_config.h"
#include "mongo/util/concurrency/list.h"
@@ -63,7 +65,7 @@ namespace repl {
// not arbiter, not priority 0
bool potentiallyHot() const { return _config.potentiallyHot(); }
- void summarizeMember(stringstream& s) const;
+ void summarizeMember(std::stringstream& s) const;
// If we could sync from this member. This doesn't tell us anything about the quality of
// this member, just if they are a possible sync target.
bool syncable() const;
diff --git a/src/mongo/db/repl/repl_set_seed_list.cpp b/src/mongo/db/repl/repl_set_seed_list.cpp
index 6398010b1f0..776e4410455 100644
--- a/src/mongo/db/repl/repl_set_seed_list.cpp
+++ b/src/mongo/db/repl/repl_set_seed_list.cpp
@@ -44,9 +44,9 @@ namespace repl {
/** @param cfgString <setname>/<seedhost1>,<seedhost2> */
void parseReplSetSeedList(const std::string& cfgString,
- string& setname,
- vector<HostAndPort>& seeds,
- set<HostAndPort>& seedSet) {
+ std::string& setname,
+ std::vector<HostAndPort>& seeds,
+ std::set<HostAndPort>& seedSet) {
const char *p = cfgString.c_str();
const char *slash = strchr(p, '/');
if( slash )
diff --git a/src/mongo/db/repl/repl_set_seed_list.h b/src/mongo/db/repl/repl_set_seed_list.h
index 2dbf3ba7cdd..78216c034a4 100644
--- a/src/mongo/db/repl/repl_set_seed_list.h
+++ b/src/mongo/db/repl/repl_set_seed_list.h
@@ -28,6 +28,7 @@
#pragma once
+#include <set>
#include <string>
#include <vector>
@@ -38,8 +39,8 @@ namespace repl {
void parseReplSetSeedList(const std::string& cfgString,
std::string& setname,
- vector<HostAndPort>& seeds,
- set<HostAndPort>& seedSet);
+ std::vector<HostAndPort>& seeds,
+ std::set<HostAndPort>& seedSet);
/** Parameter given to the --replSet command line option (parsed).
Syntax is "<setname>/<seedhost1>,<seedhost2>"
@@ -50,8 +51,8 @@ namespace repl {
parseReplSetSeedList(cfgString, setname, seeds, seedSet);
}
std::string setname;
- vector<HostAndPort> seeds;
- set<HostAndPort> seedSet;
+ std::vector<HostAndPort> seeds;
+ std::set<HostAndPort> seedSet;
};
} // namespace repl
diff --git a/src/mongo/db/repl/rs_config.h b/src/mongo/db/repl/rs_config.h
index de07640335c..29e61e216c3 100644
--- a/src/mongo/db/repl/rs_config.h
+++ b/src/mongo/db/repl/rs_config.h
@@ -32,6 +32,7 @@
#pragma once
+#include "mongo/db/jsobj.h"
#include "mongo/util/concurrency/list.h"
#include "mongo/util/concurrency/race.h"
#include "mongo/util/net/hostandport.h"
diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp
index 1d03496c720..f3db457ac93 100644
--- a/src/mongo/db/write_concern.cpp
+++ b/src/mongo/db/write_concern.cpp
@@ -32,6 +32,7 @@
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/db/repl/repl_settings.h"
#include "mongo/db/repl/write_concern.h"
+#include "mongo/db/server_options.h"
#include "mongo/db/stats/timer_stats.h"
#include "mongo/db/storage/mmap_v1/dur.h"
#include "mongo/db/storage/storage_engine.h"
diff --git a/src/mongo/s/distlock.cpp b/src/mongo/s/distlock.cpp
index 3e9d62fe6e3..8150a8cfdf5 100644
--- a/src/mongo/s/distlock.cpp
+++ b/src/mongo/s/distlock.cpp
@@ -33,6 +33,7 @@
#include <boost/thread/thread.hpp>
+#include "mongo/db/server_options.h"
#include "mongo/client/dbclientcursor.h"
#include "mongo/s/type_locks.h"
#include "mongo/s/type_lockpings.h"
diff --git a/src/mongo/util/net/listen.cpp b/src/mongo/util/net/listen.cpp
index bf260143f9d..886a974d679 100644
--- a/src/mongo/util/net/listen.cpp
+++ b/src/mongo/util/net/listen.cpp
@@ -32,6 +32,7 @@
#include "mongo/util/net/listen.h"
+#include "mongo/db/server_options.h"
#include "mongo/base/owned_pointer_vector.h"
#include "mongo/util/log.h"
#include "mongo/util/net/message_port.h"
@@ -135,7 +136,10 @@ namespace mongo {
_mine = ipToAddrs(_ip.c_str(), _port, false);
#endif
- for (vector<SockAddr>::const_iterator it=_mine.begin(), end=_mine.end(); it != end; ++it) {
+ for (std::vector<SockAddr>::const_iterator it=_mine.begin(), end=_mine.end();
+ it != end;
+ ++it) {
+
const SockAddr& me = *it;
SOCKET sock = ::socket(me.getType(), SOCK_STREAM, 0);
diff --git a/src/mongo/util/net/message_port.cpp b/src/mongo/util/net/message_port.cpp
index 01bd875806b..f3ab2414890 100644
--- a/src/mongo/util/net/message_port.cpp
+++ b/src/mongo/util/net/message_port.cpp
@@ -108,13 +108,13 @@ namespace mongo {
};
class Ports {
- set<MessagingPort*> ports;
+ std::set<MessagingPort*> ports;
mongo::mutex m;
public:
Ports() : ports(), m("Ports") {}
void closeAll(unsigned skip_mask) {
scoped_lock bl(m);
- for ( set<MessagingPort*>::iterator i = ports.begin(); i != ports.end(); i++ ) {
+ for ( std::set<MessagingPort*>::iterator i = ports.begin(); i != ports.end(); i++ ) {
if( (*i)->tag & skip_mask )
continue;
(*i)->shutdown();
@@ -181,8 +181,8 @@ again:
if ( len == 542393671 ) {
// an http GET
string msg = "It looks like you are trying to access MongoDB over HTTP on the native driver port.\n";
- LOG( psock->getLogLevel() ) << msg << endl;
- stringstream ss;
+ LOG( psock->getLogLevel() ) << msg;
+ std::stringstream ss;
ss << "HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Type: text/plain\r\nContent-Length: " << msg.size() << "\r\n\r\n" << msg;
string s = ss.str();
send( s.c_str(), s.size(), "http" );
@@ -219,7 +219,7 @@ again:
if ( static_cast<size_t>(len) < sizeof(MSGHEADER) ||
static_cast<size_t>(len) > MaxMessageSizeBytes ) {
LOG(0) << "recv(): message len " << len << " is invalid. "
- << "Min " << sizeof(MSGHEADER) << " Max: " << MaxMessageSizeBytes << endl;
+ << "Min " << sizeof(MSGHEADER) << " Max: " << MaxMessageSizeBytes;
return false;
}
@@ -244,7 +244,7 @@ again:
logger::LogSeverity severity = psock->getLogLevel();
if (!e.shouldPrint())
severity = severity.lessSevere();
- LOG(severity) << "SocketException: remote: " << remote() << " error: " << e << endl;
+ LOG(severity) << "SocketException: remote: " << remote() << " error: " << e;
m.reset();
return false;
}
@@ -274,13 +274,13 @@ again:
//log() << "got response: " << response.data->responseTo << endl;
if ( response.header()->responseTo == toSend.header()->id )
break;
- error() << "MessagingPort::call() wrong id got:" << hex << (unsigned)response.header()->responseTo << " expect:" << (unsigned)toSend.header()->id << '\n'
- << dec
+ error() << "MessagingPort::call() wrong id got:" << std::hex << (unsigned)response.header()->responseTo << " expect:" << (unsigned)toSend.header()->id << '\n'
+ << std::dec
<< " toSend op: " << (unsigned)toSend.operation() << '\n'
<< " response msgid:" << (unsigned)response.header()->id << '\n'
<< " response len: " << (unsigned)response.header()->len << '\n'
<< " response op: " << response.operation() << '\n'
- << " remote: " << psock->remoteString() << endl;
+ << " remote: " << psock->remoteString();
verify(false);
response.reset();
}
diff --git a/src/mongo/util/net/message_server_port.cpp b/src/mongo/util/net/message_server_port.cpp
index 0af5fa698cf..77526c47f6b 100644
--- a/src/mongo/util/net/message_server_port.cpp
+++ b/src/mongo/util/net/message_server_port.cpp
@@ -35,6 +35,7 @@
#include "mongo/db/lasterror.h"
+#include "mongo/db/server_options.h"
#include "mongo/db/stats/counters.h"
#include "mongo/stdx/functional.h"
#include "mongo/util/concurrency/thread_name.h"
diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp
index 5b1b2cf2a4f..70923c7ab65 100644
--- a/src/mongo/util/net/sock.cpp
+++ b/src/mongo/util/net/sock.cpp
@@ -45,6 +45,7 @@
# endif
#endif
+#include "mongo/db/server_options.h"
#include "mongo/util/background.h"
#include "mongo/util/concurrency/value.h"
#include "mongo/util/fail_point_service.h"