File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -503,13 +503,22 @@ _mongoc_cursor_query (mongoc_cursor_t *cursor)
503
503
goto failure ;
504
504
}
505
505
506
- if ((cursor -> rpc .header .opcode != MONGOC_OPCODE_REPLY ) ||
507
- (cursor -> rpc .header .response_to != request_id )) {
508
- bson_set_error (& cursor -> error ,
509
- MONGOC_ERROR_PROTOCOL ,
510
- MONGOC_ERROR_PROTOCOL_INVALID_REPLY ,
511
- "A reply to an invalid request id was received." );
512
- goto failure ;
506
+ if (cursor -> rpc .header .opcode != MONGOC_OPCODE_REPLY ) {
507
+ bson_set_error (& cursor -> error ,
508
+ MONGOC_ERROR_PROTOCOL ,
509
+ MONGOC_ERROR_PROTOCOL_INVALID_REPLY ,
510
+ "Invalid opcode. Expected %d, got %d." ,
511
+ MONGOC_OPCODE_REPLY , cursor -> rpc .header .opcode );
512
+ GOTO (failure );
513
+ }
514
+
515
+ if (cursor -> rpc .header .response_to != request_id ) {
516
+ bson_set_error (& cursor -> error ,
517
+ MONGOC_ERROR_PROTOCOL ,
518
+ MONGOC_ERROR_PROTOCOL_INVALID_REPLY ,
519
+ "Invalid response_to. Expected %d, got %d." ,
520
+ request_id , cursor -> rpc .header .response_to );
521
+ GOTO (failure );
513
522
}
514
523
515
524
if (_mongoc_cursor_unwrap_failure (cursor )) {
You can’t perform that action at this time.
0 commit comments