Skip to content

Commit 0fc38bc

Browse files
committed
CDRIVER-1023: find results can be more then 16mb
1 parent 885180b commit 0fc38bc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/mongoc/mongoc-async-cmd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "mongoc-opcode.h"
2525
#include "mongoc-rpc-private.h"
2626
#include "mongoc-stream-private.h"
27+
#include "mongoc-server-description-private.h"
2728
#include "utlist.h"
2829

2930
#ifdef MONGOC_ENABLE_SSL
@@ -327,7 +328,7 @@ _mongoc_async_cmd_phase_recv_len (mongoc_async_cmd_t *acmd)
327328
memcpy (&msg_len, acmd->buffer.data, 4);
328329
msg_len = BSON_UINT32_FROM_LE (msg_len);
329330

330-
if ((msg_len < 16) || (msg_len > (1024 * 1024 * 16))) {
331+
if ((msg_len < 16) || (msg_len > MONGOC_DEFAULT_MAX_MSG_SIZE)) {
331332
bson_set_error (&acmd->error, MONGOC_ERROR_PROTOCOL,
332333
MONGOC_ERROR_PROTOCOL_INVALID_REPLY,
333334
"Invalid reply from server.");

src/mongoc/mongoc-cluster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ mongoc_cluster_run_command_rpc (mongoc_cluster_t *cluster,
173173

174174
memcpy (&msg_len, buffer->data, 4);
175175
msg_len = BSON_UINT32_FROM_LE(msg_len);
176-
if ((msg_len < 16) || (msg_len > (1024 * 1024 * 16))) {
176+
if ((msg_len < 16) || (msg_len > MONGOC_DEFAULT_MAX_MSG_SIZE)) {
177177
GOTO (done);
178178
}
179179

0 commit comments

Comments
 (0)