Turn Unit into a built Request (#223)

This involved removing the Request reference from Unit, and adding an
Agent, a method, and headers.

Also, move is_retryable to Unit.
This commit is contained in:
Jacob Hoffman-Andrews
2020-11-14 01:12:01 -08:00
committed by GitHub
parent acc36ac370
commit ec8dace1af
6 changed files with 82 additions and 75 deletions

View File

@@ -330,8 +330,8 @@ impl<R: Read + Sized + Into<Stream>> PoolReturnRead<R> {
stream.reset()?;
// insert back into pool
let key = PoolKey::new(&unit.url, unit.req.agent.config.proxy.clone());
unit.req.agent.state.pool.add(key, stream);
let key = PoolKey::new(&unit.url, unit.agent.config.proxy.clone());
unit.agent.state.pool.add(key, stream);
}
Ok(())