Retry HTTP downloads if we don't get a full patch
Dependencies
- [2]
OIOMXESDBetter error handling in HTTP - [3]
IQ4FCHPZHTTP connections: pooling + retry on error - [4]
VBMXB443Retrying if the HTTP connection drops while reading the body - [5]
BVVMTOYWProper renaming of changes downloaded over HTTP - [6]
AI73GKAOAdding a UserAgent header to the http downloader - [7]
JRENVH5DReqwest 0.11 - [8]
TPEH2XNB1.0.0-alpha.28, with Tokio 1.0 - [*]
FBXYP7QMForgot to add remote::http
Change contents
- edit in pijul/src/remote/http.rs at line 36
use tokio::io::AsyncWriteExt; - edit in pijul/src/remote/http.rs at line 41
use tokio::io::AsyncWriteExt; - edit in pijul/src/remote/http.rs at line 48
f.flush().await?; - edit in pijul/src/remote/http.rs at line 76
let mut size = res.headers().get(reqwest::header::CONTENT_LENGTH).and_then(|x| x.to_str().ok()).unwrap_or("0").parse::<usize>().ok(); - replacement in pijul/src/remote/http.rs at line 85
Ok(Some(chunk)) => send.send(Some(chunk)).await?,Ok(None) => done = true,Ok(Some(chunk)) => {if let Some(ref mut s) = size {*s -= chunk.len();}send.send(Some(chunk)).await?;}Ok(None) => match size {Some(0) | None => done = true,_ => break,},