When the data currently in the cursor is exhausted, the mongo_cursor_next routine will call the 'private' mongo_cursor_get_more routine to see if there is any additional data. If not, mongo_cursor_next returns 0. At this point, the cursor never has a chance to get any more data (without a requery) because this code in mongo_cursor_next prevents another call to mongo_cursor_get_more.
/* no data */
if (!cursor->mm || cursor->mm->fields.num == 0)
return 0;
I found that if I make the mongo_cursor_get_more routine 'public', i.e., put it in mongo.h, and then add this code
if ( mongo_cursor_get_more( m_pCursor ) )
bson_init( &m_pCursor->current, &m_pCursor->mm->objs, 0 );
prior to calling mongo_query_next, I get the desired results. This seems like a pretty vulgar hack to me...
If there was a way to tell that a cursor was 'tailable' from the cursor structure, the above logic could be worked into the mongo_cursor_next routine.