0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

get profiling level

This commit is contained in:
Dwight 2008-04-29 15:34:11 -04:00
parent a8339eedf6
commit 9b01407c9f

View File

@ -470,8 +470,17 @@ inline bool _runCommands(const char *ns, JSObj& jsobj, stringstream& ss, BufBuil
else if( e.type() == Number ) {
if( strcmp(e.fieldName(), "profile") == 0 ) {
anObjBuilderForYa.append("was", (double) client->profile);
client->profile = (int) e.number();
valid = ok = true;
int p = (int) e.number();
valid = true;
if( p == -1 )
ok = true;
else if( p >= 0 && p <= 2 ) {
ok = true;
client->profile = p;
}
else {
ok = false;
}
}
else {
if( strncmp(ns, "admin", p-ns) != 0 ) // admin only