]> git.proxmox.com Git - proxmox-backup.git/commitdiff
data_blob: add TODO comment for zstd api
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 8 Aug 2024 08:18:25 +0000 (10:18 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 30 Aug 2024 07:57:32 +0000 (09:57 +0200)
we currently use the behavior of zstd that is not part of the public
api, so this is at risk to be changed without notice.

There is a public api that we could use, but it's only available
with zstd_sys >= 2.0.9, which at this time, is not yet packaged for/by
us.

Add a comment that we can use the public api for this when the
new version of the crate gets available.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
pbs-datastore/src/data_blob.rs

index fd84f4be95e98832162063c2c69eceda4379ee09..0fb4d44c2af5f3c37ee65b9c98f1fe1c250e86fa 100644 (file)
@@ -556,6 +556,8 @@ impl<'a, 'b> DataChunkBuilder<'a, 'b> {
 ///
 /// There is a test below to ensure we catch any change in the interface or internal value.
 fn zstd_error_is_target_too_small(err: usize) -> bool {
+    // TODO: when zstd_sys >= 2.0.9 is available, we can use
+    // ZSTD_getErrorCode and the enum to use the public zstd API
     let (real_code, _) = 0usize.overflowing_sub(err);
     // see ZSTD_ErrorCode in https://github.com/facebook/zstd/blob/dev/lib/zstd_errors.h
     real_code == 70 // ZSTD_error_dstSize_tooSmall