File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -605,20 +605,29 @@ _mongoc_cursor_get_more (mongoc_cursor_t *cursor)
605
605
& cursor -> buffer ,
606
606
cursor -> hint ,
607
607
& cursor -> error )) {
608
- goto failure ;
608
+ GOTO ( failure ) ;
609
609
}
610
610
611
- if ((cursor -> rpc .header .opcode != MONGOC_OPCODE_REPLY ) ||
612
- (cursor -> rpc .header .response_to != request_id )) {
613
- bson_set_error (& cursor -> error ,
614
- MONGOC_ERROR_PROTOCOL ,
615
- MONGOC_ERROR_PROTOCOL_INVALID_REPLY ,
616
- "A reply to an invalid request id was received." );
617
- goto failure ;
611
+ if (cursor -> rpc .header .opcode != MONGOC_OPCODE_REPLY ) {
612
+ bson_set_error (& cursor -> error ,
613
+ MONGOC_ERROR_PROTOCOL ,
614
+ MONGOC_ERROR_PROTOCOL_INVALID_REPLY ,
615
+ "Invalid opcode. Expected %d, got %d." ,
616
+ MONGOC_OPCODE_REPLY , cursor -> rpc .header .opcode );
617
+ GOTO (failure );
618
+ }
619
+
620
+ if (cursor -> rpc .header .response_to != request_id ) {
621
+ bson_set_error (& cursor -> error ,
622
+ MONGOC_ERROR_PROTOCOL ,
623
+ MONGOC_ERROR_PROTOCOL_INVALID_REPLY ,
624
+ "Invalid response_to. Expected %d, got %d." ,
625
+ request_id , cursor -> rpc .header .response_to );
626
+ GOTO (failure );
618
627
}
619
628
620
629
if (_mongoc_cursor_unwrap_failure (cursor )) {
621
- goto failure ;
630
+ GOTO ( failure ) ;
622
631
}
623
632
624
633
if (cursor -> reader ) {
You can’t perform that action at this time.
0 commit comments