diff options
Diffstat (limited to 'src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp')
-rw-r--r-- | src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp index ad4c957e598..6b10eb476e6 100644 --- a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp +++ b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp @@ -35,41 +35,39 @@ namespace mongo { namespace { - class WhatsMyUriCmd : public Command { - public: - WhatsMyUriCmd() : Command("whatsmyuri") { } +class WhatsMyUriCmd : public Command { +public: + WhatsMyUriCmd() : Command("whatsmyuri") {} - virtual bool slaveOk() const { - return true; - } + virtual bool slaveOk() const { + return true; + } - virtual bool isWriteCommandForConfigServer() const { - return false; - } + virtual bool isWriteCommandForConfigServer() const { + return false; + } - virtual void help(std::stringstream &help) const { - help << "{whatsmyuri:1}"; - } + virtual void help(std::stringstream& help) const { + help << "{whatsmyuri:1}"; + } - virtual void addRequiredPrivileges(const std::string& dbname, - const BSONObj& cmdObj, - std::vector<Privilege>* out) { + virtual void addRequiredPrivileges(const std::string& dbname, + const BSONObj& cmdObj, + std::vector<Privilege>* out) { + // No auth required + } - // No auth required - } + virtual bool run(OperationContext* txn, + const std::string& dbname, + BSONObj& cmdObj, + int options, + std::string& errmsg, + BSONObjBuilder& result) { + result << "you" << cc().getRemote().toString(); + return true; + } - virtual bool run(OperationContext* txn, - const std::string& dbname, - BSONObj& cmdObj, - int options, - std::string& errmsg, - BSONObjBuilder& result) { +} whatsMyUriCmd; - result << "you" << cc().getRemote().toString(); - return true; - } - - } whatsMyUriCmd; - -} // namespace -} // namespace mongo +} // namespace +} // namespace mongo |