diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2018-07-25 15:53:38 -0400 |
---|---|---|
committer | Matthew Russotto <matthew.russotto@10gen.com> | 2018-08-06 10:46:36 -0400 |
commit | c35307abae44b2291a6b82571a1defff2bf188a3 (patch) | |
tree | f70fe5e638d0fa4a3afc89bd31df39355cd2cdd9 /src/mongo/client | |
parent | 4e57f57add2ad51a1c8cafd3fa05ec50b6437797 (diff) | |
download | mongo-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.cpp | 4 |
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. |