update tokio-native-tls

This commit is contained in:
fakeshadow 2020-12-25 01:30:57 +08:00
parent e4359f7589
commit 36e4fb44e8
2 changed files with 3 additions and 1 deletions

View File

@ -53,7 +53,7 @@ webpki-roots = { version = "0.20", optional = true }
# native-tls
native-tls = { version = "0.2", optional = true }
tokio-native-tls = { version = "0.2.0", optional = true }
tokio-native-tls = { version = "0.3.0", optional = true }
[dev-dependencies]
bytes = "1"

View File

@ -115,6 +115,8 @@ impl<T: AsyncRead + AsyncWrite + Unpin> Future for AcceptorServiceResponse<T> {
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
loop {
match self.as_mut().get_mut() {
// Init branch only used to return the error in future
// on success goes to Accept branch directly.
AcceptorServiceResponse::Init(res, guard) => {
let guard = guard.take();
let stream = res.take().unwrap()?;