mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 08:55:40 +01:00
Update append_frames_vectored to use new encryption_ctx and apply review
This commit is contained in:
@@ -1291,7 +1291,12 @@ impl Pager {
|
||||
if !pages.is_empty() {
|
||||
let c = wal
|
||||
.borrow_mut()
|
||||
.append_frames_vectored(pages, page_sz, commit_frame)?;
|
||||
.append_frames_vectored(pages, page_sz, commit_frame)
|
||||
.inspect_err(|_| {
|
||||
for c in completions.iter() {
|
||||
c.abort();
|
||||
}
|
||||
})?;
|
||||
completions.push(c);
|
||||
}
|
||||
Ok(completions)
|
||||
|
||||
@@ -1442,9 +1442,9 @@ impl Wal for WalFile {
|
||||
let plain = page.get_contents().as_ptr();
|
||||
|
||||
let data_to_write: std::borrow::Cow<[u8]> = {
|
||||
let key = self.encryption_key.borrow();
|
||||
if let Some(k) = key.as_ref() {
|
||||
Cow::Owned(encrypt_page(plain, page_id as usize, k)?)
|
||||
let ectx = self.encryption_ctx.borrow();
|
||||
if let Some(ctx) = ectx.as_ref() {
|
||||
Cow::Owned(ctx.encrypt_page(plain, page_id as usize)?)
|
||||
} else {
|
||||
Cow::Borrowed(plain)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user