Skip to content

Commit e13b518

Browse files
committed
more tests
1 parent d661cef commit e13b518

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

ntex/src/http/client/connector.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,13 @@ where
344344

345345
#[inline]
346346
fn poll_shutdown(&self, cx: &mut Context<'_>, is_error: bool) -> Poll<()> {
347-
let ready = self.tcp_pool.poll_shutdown(cx, is_error).is_ready();
348-
let ready = if let Some(ref ssl_pool) = self.ssl_pool {
349-
ssl_pool.poll_shutdown(cx, is_error).is_ready() && ready
350-
} else {
351-
ready
352-
};
353-
if ready {
347+
let tcp_ready = self.tcp_pool.poll_shutdown(cx, is_error).is_ready();
348+
let ssl_ready = self
349+
.ssl_pool
350+
.as_ref()
351+
.map(|pool| pool.poll_shutdown(cx, is_error).is_ready())
352+
.unwrap_or(true);
353+
if tcp_ready && ssl_ready {
354354
Poll::Ready(())
355355
} else {
356356
Poll::Pending

ntex/src/http/client/pool.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,5 +666,8 @@ mod tests {
666666
delay_for(Duration::from_millis(50)).await;
667667
pool.1.borrow_mut().check_availibility();
668668
assert!(pool.1.borrow().waiters.is_empty());
669+
670+
assert!(lazy(|cx| pool.poll_ready(cx)).await.is_ready());
671+
assert!(lazy(|cx| pool.poll_shutdown(cx, false)).await.is_ready());
669672
}
670673
}

0 commit comments

Comments
 (0)