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

clean up dbMsg - marg deprecated

This commit is contained in:
Eliot Horowitz 2010-02-16 01:05:04 -05:00
parent 6dbd99b3db
commit abdc594a66
2 changed files with 15 additions and 12 deletions

View File

@ -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);

View File

@ -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;