summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2010-04-06 10:41:19 -0700
committerAaron <aaron@10gen.com>2010-04-06 10:41:19 -0700
commite18041f47b0b3a885f9e54e35925572c2e28995a (patch)
tree1cf39af6296c4a655520c1a9135a3fad209997c0
parent00f604c06334bad02565e8fc6bb300708d67f395 (diff)
downloadmongo-e18041f47b0b3a885f9e54e35925572c2e28995a.tar.gz
SERVER-832 add ping command
-rw-r--r--db/dbcommands.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index 9d5ebb49b39..e97bfa6d3d8 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -1740,6 +1740,18 @@ namespace mongo {
DBDirectClient _db;
} dbhashCmd;
+ class PingCommand : public Command {
+ public:
+ PingCommand() : Command( "ping" ){}
+ virtual bool slaveOk() { return true; }
+ virtual LockType locktype() { return NONE; }
+ virtual bool requiresAuth() { return false; }
+ virtual bool run(const char * badns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool){
+ // IMPORTANT: Don't put anything in here that might lock db - including authentication
+ return true;
+ }
+ } pingCmd;
+
/**
* this handles
- auth