We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2eb9dc commit 6e5875aCopy full SHA for 6e5875a
src/ceph.rs
@@ -1049,7 +1049,7 @@ impl IoCtx {
1049
fill_buffer.reserve_exact(DEFAULT_READ_BYTES);
1050
}
1051
1052
- with_completion(self, |c| unsafe {
+ let result = with_completion(self, |c| unsafe {
1053
rados_aio_read(
1054
self.ioctx,
1055
obj_name_str.as_ptr(),
@@ -1059,7 +1059,20 @@ impl IoCtx {
1059
read_offset,
1060
)
1061
})?
1062
- .await
+ .await;
1063
+
1064
+ if let Ok(rval) = &result {
1065
+ unsafe {
1066
+ // Completion should have handled any negative (error) values already
1067
+ assert!(*rval >= 0);
1068
1069
+ let len = *rval as usize;
1070
+ assert!(len <= fill_buffer.capacity());
1071
+ fill_buffer.set_len(len);
1072
+ }
1073
1074
1075
+ result
1076
1077
1078
/// Get object stats (size,SystemTime)
0 commit comments