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

Merge branch 'master' of ssh://aaron@git.10gen.com/data/gitroot/p

This commit is contained in:
Aaron 2008-12-09 12:05:24 -05:00
commit 7d9d477e68
3 changed files with 15 additions and 3 deletions

View File

@ -27,6 +27,7 @@
#include "dbmessage.h"
#include "instance.h"
extern bool objcheck;
bool useJNI = true;
/* only off if --nocursors which is for debugging. */
@ -534,6 +535,8 @@ int main(int argc, char* argv[], char *envp[] )
master = true;
else if( s == "--slave" )
slave = true;
else if( s == "--objcheck" )
objcheck = true;
else if( s == "--source" ) {
/* specifies what the source in local.sources should be */
dashDashSource = argv[++i];
@ -572,7 +575,10 @@ int main(int argc, char* argv[], char *envp[] )
cout << " quicktest just check basic assertions and exit" << endl;
cout << " test2 run test2() - see code" << endl;
cout << "\nOptions:" << endl;
cout << " --port <portno> --dbpath <root> --appsrvpath <root of appsrv>" << endl;
cout << " --objcheck inspect client data for validity on receipt\n";
cout << " --port <portno>\n";
cout << " --dbpath <root>\n";
cout << " --appsrvpath <root of appsrv>" << endl;
cout << " --nocursors --nojni" << endl;
cout << " --oplog<n> 0=off 1=W 2=R 3=both 7=W+some reads" << endl;
cout << "\nReplication:" << endl;

View File

@ -190,8 +190,9 @@ void receivedGetMore(DbResponse& dbresponse, /*AbstractMessagingPort& dbMsgPort,
//dbMsgPort.reply(m, resp);
}
bool objcheck = false;
void receivedInsert(Message& m, stringstream& ss) {
// cout << "GOT MSG id:" << m.data->id << endl;
DbMessage d(m);
while( d.moreJSObjs() ) {
BSONObj js = d.nextJsObj();
@ -199,6 +200,12 @@ void receivedInsert(Message& m, stringstream& ss) {
assert(*ns);
setClient(ns);
ss << ns;
if( objcheck && !js.valid() ) {
problem() << "insert error ns: " << ns << '\n';
uassert("insert: bad object from client", false);
}
theDataFileMgr.insert(ns, (void*) js.objdata(), js.objsize());
logOp("i", ns, js);
}

View File

@ -17,7 +17,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "db.h"
#include "../db/btree.h"
#include "../db/db.h"