diff options
Diffstat (limited to 'src/mongo/client/dbclientcursor.cpp')
-rw-r--r-- | src/mongo/client/dbclientcursor.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mongo/client/dbclientcursor.cpp b/src/mongo/client/dbclientcursor.cpp index bfd4108f6ea..ab80830adf3 100644 --- a/src/mongo/client/dbclientcursor.cpp +++ b/src/mongo/client/dbclientcursor.cpp @@ -62,7 +62,7 @@ namespace mongo { bool DBClientCursor::init() { Message toSend; _assembleInit( toSend ); - assert( _client ); + verify( _client ); if ( !_client->call( toSend, *batch.m, false, &_originalHost ) ) { // log msg temp? log() << "DBClientCursor::init call() failed" << endl; @@ -107,11 +107,11 @@ namespace mongo { } void DBClientCursor::requestMore() { - assert( cursorId && batch.pos == batch.nReturned ); + verify( cursorId && batch.pos == batch.nReturned ); if (haveLimit) { nToReturn -= batch.nReturned; - assert(nToReturn > 0); + verify(nToReturn > 0); } BufBuilder b; b.appendNum(opts); @@ -129,7 +129,7 @@ namespace mongo { dataReceived(); } else { - assert( _scopedHost.size() ); + verify( _scopedHost.size() ); ScopedDbConnection conn( _scopedHost ); conn->call( toSend , *response ); _client = conn.get(); @@ -142,10 +142,10 @@ namespace mongo { /** with QueryOption_Exhaust, the server just blasts data at us (marked at end with cursorid==0). */ void DBClientCursor::exhaustReceiveMore() { - assert( cursorId && batch.pos == batch.nReturned ); - assert( !haveLimit ); + verify( cursorId && batch.pos == batch.nReturned ); + verify( !haveLimit ); auto_ptr<Message> response(new Message()); - assert( _client ); + verify( _client ); if ( _client->recv(*response) ) { batch.m = response; dataReceived(); @@ -163,7 +163,7 @@ namespace mongo { if ( qr->resultFlags() & ResultFlag_CursorNotFound ) { // cursor id no longer valid at the server. - assert( qr->cursorId == 0 ); + verify( qr->cursorId == 0 ); cursorId = 0; // 0 indicates no longer valid (dead) if ( ! ( opts & QueryOption_CursorTailable ) ) throw UserException( 13127 , "getMore: cursor didn't exist on server, possible restart or timeout?" ); @@ -183,12 +183,12 @@ namespace mongo { if( qr->resultFlags() & ResultFlag_ShardConfigStale ) { BSONObj error; - assert( peekError( &error ) ); + verify( peekError( &error ) ); throw RecvStaleConfigException( (string)"stale config on lazy receive" + causedBy( getErrField( error ) ), error ); } /* this assert would fire the way we currently work: - assert( nReturned || cursorId == 0 ); + verify( nReturned || cursorId == 0 ); */ } @@ -267,17 +267,17 @@ namespace mongo { vector<BSONObj> v; peek(v, 1); - assert( v.size() == 1 ); - assert( hasErrField( v[0] ) ); + verify( v.size() == 1 ); + verify( hasErrField( v[0] ) ); if( error ) *error = v[0].getOwned(); return true; } void DBClientCursor::attach( AScopedConnection * conn ) { - assert( _scopedHost.size() == 0 ); - assert( conn ); - assert( conn->get() ); + verify( _scopedHost.size() == 0 ); + verify( conn ); + verify( conn->get() ); if ( conn->get()->type() == ConnectionString::SET || conn->get()->type() == ConnectionString::SYNC ) { @@ -322,7 +322,7 @@ namespace mongo { } else { - assert( _scopedHost.size() ); + verify( _scopedHost.size() ); ScopedDbConnection conn( _scopedHost ); if( DBClientConnection::getLazyKillCursor() ) |