feat(client): Client will retry requests on fresh connections

If a request sees an error on a pooled connection before ever writing
any bytes, it will now retry with a new connection.

This can be configured with `Config::retry_canceled_requests(bool)`.
This commit is contained in:
Sean McArthur
2018-02-15 12:04:58 -08:00
parent 0ea3bcf8d5
commit ee61ea9adf
6 changed files with 234 additions and 124 deletions

View File

@@ -211,6 +211,12 @@ pub struct Pooled<T> {
pool: Weak<RefCell<PoolInner<T>>>,
}
impl<T> Pooled<T> {
pub fn is_reused(&self) -> bool {
self.entry.is_reused
}
}
impl<T> Deref for Pooled<T> {
type Target = T;
fn deref(&self) -> &T {