summaryrefslogtreecommitdiff
path: root/db/query.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'db/query.cpp')
-rw-r--r--db/query.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/db/query.cpp b/db/query.cpp
index 5bd7b00..154fd15 100644
--- a/db/query.cpp
+++ b/db/query.cpp
@@ -320,7 +320,6 @@ namespace mongo {
while ( 1 ) {
if ( !c->ok() ) {
-// log() << "TEMP Tailable : " << c->tailable() << ' ' << (queryOptions & QueryOption_AwaitData) << endl;
if ( c->tailable() ) {
/* when a tailable cursor hits "EOF", ok() goes false, and current() is null. however
advance() can still be retries as a reactivation attempt. when there is new data, it will
@@ -787,8 +786,10 @@ namespace mongo {
if ( _pq.isExplain()) {
_eb.noteScan( _c.get(), _nscanned, _nscannedObjects, _n, scanAndOrderRequired(), _curop.elapsedMillis(), useHints && !_pq.getHint().eoo() );
} else {
- _response.appendData( _buf.buf(), _buf.len() );
- _buf.decouple();
+ if (_buf.len()) {
+ _response.appendData( _buf.buf(), _buf.len() );
+ _buf.decouple();
+ }
}
if ( stop ) {
setStop();