Giter VIP home page Giter VIP logo

async_http_range_reader's Introduction

Async HTTP Range Reader

Crates.io docs.rs GitHub Workflow Status (branch) GitHub

A crate that provides the AsyncHttpRangeReader struct, which allows streaming files over HTTP using range requests.

async_http_range_reader's People

Contributors

baszalmstra avatar github-actions[bot] avatar konstin avatar charliermarsh avatar zanieb avatar

Stargazers

Felipe Menegazzi avatar  avatar Prayag avatar ringsaturn avatar Kyle Barron avatar 虫子樱桃 avatar  avatar Ruben Arts avatar Shitty Girl avatar

Watchers

 avatar  avatar  avatar  avatar

async_http_range_reader's Issues

Please consider supporting the current release of async_zip

I was investigating packaging this crate for Fedora Linux as a dependency for a potential uv package.

It would be very helpful if async_http_range_reader could support the current release of async_zip, 0.0.17, instead of requiring 0.0.15. Release notes for 0.0.16 are here and for 0.0.17 are here.


I tried to start a PR for updating at least to 0.0.16. I needed to make a couple of changes because as of 0.0.16, StoredZipEntry now implements Deref (but no longer has an entry() method):

--- a/src/lib.rs
+++ b/src/lib.rs
@@ -707,7 +707,7 @@ mod test {
                 .file()
                 .entries()
                 .iter()
-                .map(|e| e.entry().filename().as_str().unwrap_or(""))
+                .map(|e| e.filename().as_str().unwrap_or(""))
                 .collect::<Vec<_>>(),
             vec![
                 "metadata.json",
@@ -735,7 +735,7 @@ mod test {
         // Get the size of the entry plus the header + size of the filename. We should also actually
         // include bytes for the extra fields but we don't have that information.
         let size =
-            entry.entry().compressed_size() + 30 + entry.entry().filename().as_bytes().len() as u64;
+            entry.compressed_size() + 30 + entry.filename().as_bytes().len() as u64;
 
         // The zip archive uses as BufReader which reads in chunks of 8192. To ensure we prefetch
         // enough data we round the size up to the nearest multiple of the buffer size.

Unfortunately, this isn’t enough to make the tests pass:

    Finished test [unoptimized + debuginfo] target(s) in 0.04s
     Running unittests src/lib.rs (target/debug/deps/async_http_range_reader-579b4a2869383b07)

running 6 tests
test sparse_range::test::test_sparse_range ... ok
test test::test_not_found ... ok
test test::async_range_reader::case_2 ... ok
test test::async_range_reader::case_1 ... ok
test test::async_range_reader_zip::case_2 ... FAILED
test test::async_range_reader_zip::case_1 ... FAILED

failures:

---- test::async_range_reader_zip::case_2 stdout ----
thread 'test::async_range_reader_zip::case_2' panicked at src/lib.rs:766:9:
assertion `left == right` failed
  left: 3
 right: 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- test::async_range_reader_zip::case_1 stdout ----
thread 'test::async_range_reader_zip::case_1' panicked at src/lib.rs:766:9:
assertion `left == right` failed
  left: 3
 right: 2


failures:
    test::async_range_reader_zip::case_1
    test::async_range_reader_zip::case_2

test result: FAILED. 4 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.13s

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.