Skip to content

Commit

Permalink
GODRIVER-3374 Add ReadCompressedCompressedMessage back to wiremessage…
Browse files Browse the repository at this point in the history
… API (#1870)

Co-authored-by: Matt Dale <[email protected]>
  • Loading branch information
prestonvasquez and matthewdale authored Oct 21, 2024
1 parent 6952473 commit 2036071
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions x/mongo/driver/wiremessage/wiremessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,17 @@ func ReadCompressedCompressorID(src []byte) (id CompressorID, rem []byte, ok boo
return CompressorID(src[0]), src[1:], true
}

// ReadCompressedCompressedMessage reads the compressed wiremessage to dst.
//
// Deprecated: This function is not required by the Go Driver and will be
// removed in the 2.0 release.
func ReadCompressedCompressedMessage(src []byte, length int32) (msg []byte, rem []byte, ok bool) {
if len(src) < int(length) || length < 0 {
return nil, src, false
}
return src[:length], src[length:], true
}

// ReadKillCursorsZero reads the zero field from src.
func ReadKillCursorsZero(src []byte) (zero int32, rem []byte, ok bool) {
return readi32(src)
Expand Down

0 comments on commit 2036071

Please sign in to comment.