mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-03 19:53:33 -07:00
server: compressed QMDL is decompressed in a zip
This is perhaps a bit silly, but the current output of a compressed QmdlReader is always decompressed, so when we export a ZIP, we're basically un-gzipping the QMDL before zipping it. However, this approach makes for simpler code and results in a uniform set of files for the user, which I think is worth the slight amount of wasted processing.
This commit is contained in:
@@ -337,14 +337,14 @@ pub async fn get_zip(
|
||||
|
||||
// Add QMDL file
|
||||
{
|
||||
let extension = if compressed { "qmdl.gz" } else { "qmdl" };
|
||||
let entry = ZipEntryBuilder::new(
|
||||
format!("{qmdl_idx}.{extension}").into(),
|
||||
format!("{qmdl_idx}.qmdl").into(),
|
||||
Compression::Stored,
|
||||
);
|
||||
// FuturesAsyncWriteCompatExt::compat_write because async-zip's entrystream does
|
||||
// not impl tokio's AsyncWrite, but only future's AsyncWrite. This can be removed
|
||||
// once https://github.com/Majored/rs-async-zip/pull/160 is released.
|
||||
// FuturesAsyncWriteCompatExt::compat_write because async-zip's
|
||||
// entrystream does not impl tokio's AsyncWrite, but only
|
||||
// future's AsyncWrite. This can be removed once
|
||||
// https://github.com/Majored/rs-async-zip/pull/160 is released.
|
||||
let mut entry_writer = zip.write_entry_stream(entry).await?.compat_write();
|
||||
let qmdl_store = qmdl_store_lock.read().await;
|
||||
let mut qmdl_reader = qmdl_store.open_entry_qmdl(entry_index).await?;
|
||||
|
||||
Reference in New Issue
Block a user