Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added
- Remote HTTP(S) reads and downloads now resume automatically via Range requests: if the connection is dropped mid-transfer, the reader reconnects and continues from the last byte read instead of failing. Applies to both streaming readers (`get_reader`/`get_reader_raw`) and `download`/`download_with_retry`. Resumed responses are validated (`Content-Range` start offset, and `Last-Modified` when the original response provided it) to avoid splicing mismatched data.

## v0.23.0 -- 2026-05-12

### Added
Expand Down
19 changes: 16 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ impl OneIo {
let raw_reader: Box<dyn Read + Send> = match crate::get_protocol(path) {
Some(protocol) => match protocol {
#[cfg(feature = "http")]
"http" | "https" => Box::new(self.get_http_reader_raw(path)?),
"http" | "https" => {
let response = self.get_http_reader_raw(path)?;
Box::new(crate::resumable_http::ResumableHttpReader::new(
self.http_client().clone(),
path.to_string(),
response,
))
}
#[cfg(feature = "ftp")]
"ftp" => remote::get_ftp_reader_raw(path)?,
#[cfg(feature = "s3")]
Expand Down Expand Up @@ -312,8 +319,14 @@ impl OneIo {
#[cfg(feature = "http")]
Some("http" | "https") => {
let mut writer = self.get_writer_raw(local_path)?;
let mut response = self.get_http_reader_raw(remote_path)?;
response.copy_to(&mut writer)?;
let response = self.get_http_reader_raw(remote_path)?;
let mut reader = crate::resumable_http::ResumableHttpReader::new(
self.http_client().clone(),
remote_path.to_string(),
response,
);
std::io::copy(&mut reader, &mut writer)?;
Comment on lines +322 to +328
writer.flush()?;
Ok(())
}
#[cfg(feature = "ftp")]
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ mod client;
mod compression;
mod error;
mod progress;
#[cfg(feature = "http")]
mod resumable_http;

pub use builder::OneIoBuilder;
pub use client::OneIo;
Expand Down
Loading