Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

small sniffer improvements

  • Loading branch information...
commit 473a982fab35b080f8d6fdc11f6bda5dd21e3397 1 parent add2064
@dwight dwight authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 tools/sniffer.cpp
View
14 tools/sniffer.cpp
@@ -279,7 +279,7 @@ void processMessage( Connection& c , Message& m ) {
if ( m.operation() == mongo::opReply )
out() << " - " << (unsigned)m.header()->responseTo;
- out() << endl;
+ out() << '\n';
try {
switch( m.operation() ) {
@@ -294,7 +294,16 @@ void processMessage( Connection& c , Message& m ) {
}
case mongo::dbQuery: {
mongo::QueryMessage q(d);
- out() << "\tquery: " << q.query << " ntoreturn: " << q.ntoreturn << " ntoskip: " << q.ntoskip << endl;
+ out() << "\tquery: " << q.query << " ntoreturn: " << q.ntoreturn << " ntoskip: " << q.ntoskip;
+ if( !q.fields.isEmpty() )
+ out() << " hasfields";
+ if( q.queryOptions & mongo::QueryOption_SlaveOk )
+ out() << " SlaveOk";
+ if( q.queryOptions & mongo::QueryOption_NoCursorTimeout )
+ out() << " NoCursorTimeout";
+ if( q.queryOptions & ~(mongo::QueryOption_SlaveOk | mongo::QueryOption_NoCursorTimeout) )
+ out() << " queryOptions:" << hex << q.queryOptions;
+ out() << endl;
break;
}
case mongo::dbUpdate: {
@@ -331,6 +340,7 @@ void processMessage( Connection& c , Message& m ) {
break;
}
default:
+ out() << "\tunknown opcode " << m.operation() << endl;
cerr << "*** CANNOT HANDLE TYPE: " << m.operation() << endl;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.