Fix incorrect prepare_uninitialized_buffer
This commit is contained in:
parent
074fe4a5ac
commit
7f69e889a4
@ -24,6 +24,7 @@ webpki = "0.21"
|
||||
[features]
|
||||
early-data = []
|
||||
dangerous_configuration = ["rustls/dangerous_configuration"]
|
||||
unstable = []
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "0.2.0", features = ["macros", "net", "io-util", "rt-core", "time"] }
|
||||
|
@ -69,8 +69,9 @@ impl<IO> AsyncRead for TlsStream<IO>
|
||||
where
|
||||
IO: AsyncRead + AsyncWrite + Unpin,
|
||||
{
|
||||
#[cfg(feature = "unstable")]
|
||||
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [std::mem::MaybeUninit<u8>]) -> bool {
|
||||
self.io.prepare_uninitialized_buffer(buf)
|
||||
false
|
||||
}
|
||||
|
||||
fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<io::Result<usize>> {
|
||||
|
@ -67,8 +67,12 @@ impl<IO> AsyncRead for TlsStream<IO>
|
||||
where
|
||||
IO: AsyncRead + AsyncWrite + Unpin,
|
||||
{
|
||||
#[cfg(feature = "unstable")]
|
||||
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [std::mem::MaybeUninit<u8>]) -> bool {
|
||||
self.io.prepare_uninitialized_buffer(buf)
|
||||
// TODO
|
||||
//
|
||||
// https://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.initializer
|
||||
false
|
||||
}
|
||||
|
||||
fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<io::Result<usize>> {
|
||||
|
Loading…
Reference in New Issue
Block a user