File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
MongoDB.Driver/Communication/Messages Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ internal byte[] RemoveLastDocument(BsonBuffer buffer)
60
60
var lastDocumentLength = buffer . Position - _lastDocumentStartPosition ;
61
61
buffer . Position = _lastDocumentStartPosition ;
62
62
var lastDocument = buffer . ReadBytes ( lastDocumentLength ) ;
63
+ buffer . Position = _lastDocumentStartPosition ;
63
64
buffer . Length = _lastDocumentStartPosition ;
64
65
BackpatchMessageLength ( buffer ) ;
65
66
return lastDocument ;
@@ -68,6 +69,7 @@ internal byte[] RemoveLastDocument(BsonBuffer buffer)
68
69
internal void ResetBatch ( BsonBuffer buffer , byte [ ] lastDocument )
69
70
{
70
71
buffer . Position = _firstDocumentStartPosition ;
72
+ buffer . Length = _firstDocumentStartPosition ;
71
73
buffer . WriteBytes ( lastDocument ) ;
72
74
BackpatchMessageLength ( buffer ) ;
73
75
}
You can’t perform that action at this time.
0 commit comments