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)
6060 var lastDocumentLength = buffer . Position - _lastDocumentStartPosition ;
6161 buffer . Position = _lastDocumentStartPosition ;
6262 var lastDocument = buffer . ReadBytes ( lastDocumentLength ) ;
63+ buffer . Position = _lastDocumentStartPosition ;
6364 buffer . Length = _lastDocumentStartPosition ;
6465 BackpatchMessageLength ( buffer ) ;
6566 return lastDocument ;
@@ -68,6 +69,7 @@ internal byte[] RemoveLastDocument(BsonBuffer buffer)
6869 internal void ResetBatch ( BsonBuffer buffer , byte [ ] lastDocument )
6970 {
7071 buffer . Position = _firstDocumentStartPosition ;
72+ buffer . Length = _firstDocumentStartPosition ;
7173 buffer . WriteBytes ( lastDocument ) ;
7274 BackpatchMessageLength ( buffer ) ;
7375 }
You can’t perform that action at this time.
0 commit comments