Open
Description
Issue Description
When using HTTP/3 to fetch responses larger than approximately 1MB in size, the request fails with a timeout error: error decoding response body: timeout
.
And test files from https://sampletestfile.com/jpg/
.
Reproduction Steps
- Create a Rust application using reqwest with HTTP/3 enabled
- Try to fetch a small file (~1MB) - works successfully
- Try to fetch a larger file (~6MB) - fails with timeout error
Code to Reproduce
fn fetch(url: &str) -> anyhow::Result<usize> {
let client = reqwest::blocking::Client::builder()
.http3_prior_knowledge()
.timeout(std::time::Duration::from_secs(120))
.build()?;
let response = client.get(url).version(reqwest::Version::HTTP_3).send()?;
let body = response.text()?;
Ok(body.len())
}
fn main() {
// This works fine (smaller file ~1.1MB)
let url = "https://sampletestfile.com/wp-content/uploads/2023/05/1.1-MB-1.jpg";
let size = fetch(&url).unwrap();
println!("{}", size); // Successfully prints the size: 2168562
// This fails (larger file ~6.1MB)
let url = "https://sampletestfile.com/wp-content/uploads/2023/05/6.1-MB.jpg";
let size = fetch(&url).unwrap(); // Panics here with error
println!("{}", size);
}
Error Output
thread 'main' panicked at src\main.rs:17:28:
called `Result::unwrap()` on an `Err` value: error decoding response body
Caused by:
0: request or response body error
1: timeout
Environment
- Operating System: Windows
- Rust version: 1.87.0-nightly
- reqwest version: 0.12.15
Additional Information
- I've set a timeout of 120 seconds which should be more than enough for a ~6MB file
- The issue seems to be related specifically to HTTP/3 since the same URLs work with HTTP/1.1 or HTTP/2
- The failure happens consistently for files larger than approximately 1MB
Possible Causes
This could be related to:
- Buffer size limits in the HTTP/3 implementation
- Issues with QUIC flow control
- Configuration problems with larger HTTP/3 responses
I would appreciate any insights into this issue or potential workarounds. Thank you!