Drop context on MidHandshake success [tokio-native-tls] (#12)
This commit is contained in:
parent
bd749ed734
commit
3c9b126993
@ -348,13 +348,16 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Future for MidHandshake<S> {
|
|||||||
|
|
||||||
s.get_mut().context = cx as *mut _ as *mut ();
|
s.get_mut().context = cx as *mut _ as *mut ();
|
||||||
match s.handshake() {
|
match s.handshake() {
|
||||||
Ok(stream) => Poll::Ready(Ok(TlsStream(stream))),
|
Ok(mut s) => {
|
||||||
Err(HandshakeError::Failure(e)) => Poll::Ready(Err(e)),
|
s.get_mut().context = null_mut();
|
||||||
|
Poll::Ready(Ok(TlsStream(s)))
|
||||||
|
}
|
||||||
Err(HandshakeError::WouldBlock(mut s)) => {
|
Err(HandshakeError::WouldBlock(mut s)) => {
|
||||||
s.get_mut().context = null_mut();
|
s.get_mut().context = null_mut();
|
||||||
mut_self.0 = Some(s);
|
mut_self.0 = Some(s);
|
||||||
Poll::Pending
|
Poll::Pending
|
||||||
}
|
}
|
||||||
|
Err(HandshakeError::Failure(e)) => Poll::Ready(Err(e)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user