diff --git a/db/db.cpp b/db/db.cpp index b8988a33083..ddf381b681e 100644 --- a/db/db.cpp +++ b/db/db.cpp @@ -269,8 +269,10 @@ namespace mongo { // SockAddr db("172.16.0.179", MessagingPort::DBPort); MessagingPort p; - if ( !p.connect(db) ) + if ( !p.connect(db) ){ + out() << "msg couldn't connect" << endl; return; + } const int Loops = 1; for ( int q = 0; q < Loops; q++ ) { @@ -286,8 +288,9 @@ namespace mongo { Timer t; bool ok = p.call(send, response); double tm = ((double) t.micros()) + 1; - out() << " ****ok. response.data:" << ok << " time:" << tm / 1000.0 << "ms " << - ((double) len) * 8 / 1000000 / (tm/1000000) << "Mbps" << endl; + out() << " ****ok. response.data:" << ok << " time:" << tm / 1000.0 << "ms " + << "len: " << len << " data: " << response.data->_data << endl; + if ( q+1 < Loops ) { out() << "\t\tSLEEP 8 then sending again as a test" << endl; sleepsecs(8); diff --git a/db/instance.cpp b/db/instance.cpp index 0711f62ed37..0dcf686f96a 100644 --- a/db/instance.cpp +++ b/db/instance.cpp @@ -287,22 +287,22 @@ namespace mongo { log = true; } else if ( op == dbMsg ) { - writelock lk(""); - /* deprecated / rarely used. intended for connection diagnostics. */ + // deprecated - replaced by commands char *p = m.data->_data; int len = strlen(p); if ( len > 400 ) out() << curTimeMillis() % 10000 << - " long msg received, len:" << len << - " ends with: " << p + len - 10 << endl; - bool end = false; //strcmp("end", p) == 0; + " long msg received, len:" << len << + " ends with: " << p + len - 10 << endl; + Message *resp = new Message(); - resp->setData(opReply, "i am fine"); + if ( strcmp( "end" , p ) == 0 ) + resp->setData( opReply , "dbMsg end no longer supported" ); + else + resp->setData( opReply , "i am fine - dbMsg deprecated"); + dbresponse.response = resp; dbresponse.responseTo = m.data->id; - //dbMsgPort.reply(m, resp); - if ( end ) - return false; } else { const char *ns = m.data->_data + 4;