summaryrefslogtreecommitdiff
path: root/src/mongo/client
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2018-07-25 15:53:38 -0400
committerMatthew Russotto <matthew.russotto@10gen.com>2018-08-06 10:46:36 -0400
commitc35307abae44b2291a6b82571a1defff2bf188a3 (patch)
treef70fe5e638d0fa4a3afc89bd31df39355cd2cdd9 /src/mongo/client
parent4e57f57add2ad51a1c8cafd3fa05ec50b6437797 (diff)
downloadmongo-c35307abae44b2291a6b82571a1defff2bf188a3.tar.gz
SERVER-36091 DBClientConnection::query() should pass all results to callback
DBClientConnection::query currently relies on exhaust cursor support in DBClientCursor working in a particular way, which is true for OP_QUERY exhaust but will not be true for OP_CMD exhaust. This change makes it more general, avoiding exhaust-specfic APIs.
Diffstat (limited to 'src/mongo/client')
-rw-r--r--src/mongo/client/dbclient_connection.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp
index 1903f5eaa3a..b8f9e93e7de 100644
--- a/src/mongo/client/dbclient_connection.cpp
+++ b/src/mongo/client/dbclient_connection.cpp
@@ -502,10 +502,8 @@ unsigned long long DBClientConnection::query(stdx::function<void(DBClientCursorB
n += i.n();
}
- if (c->getCursorId() == 0)
+ if (!c->more())
break;
-
- c->exhaustReceiveMore();
}
} catch (std::exception&) {
/* connection CANNOT be used anymore as more data may be on the way from the server.