Fix incorrect prepare_uninitialized_buffer
This commit is contained in:
parent
074fe4a5ac
commit
7f69e889a4
@ -24,6 +24,7 @@ webpki = "0.21"
|
|||||||
[features]
|
[features]
|
||||||
early-data = []
|
early-data = []
|
||||||
dangerous_configuration = ["rustls/dangerous_configuration"]
|
dangerous_configuration = ["rustls/dangerous_configuration"]
|
||||||
|
unstable = []
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio = { version = "0.2.0", features = ["macros", "net", "io-util", "rt-core", "time"] }
|
tokio = { version = "0.2.0", features = ["macros", "net", "io-util", "rt-core", "time"] }
|
||||||
|
@ -69,8 +69,9 @@ impl<IO> AsyncRead for TlsStream<IO>
|
|||||||
where
|
where
|
||||||
IO: AsyncRead + AsyncWrite + Unpin,
|
IO: AsyncRead + AsyncWrite + Unpin,
|
||||||
{
|
{
|
||||||
|
#[cfg(feature = "unstable")]
|
||||||
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [std::mem::MaybeUninit<u8>]) -> bool {
|
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>> {
|
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
|
where
|
||||||
IO: AsyncRead + AsyncWrite + Unpin,
|
IO: AsyncRead + AsyncWrite + Unpin,
|
||||||
{
|
{
|
||||||
|
#[cfg(feature = "unstable")]
|
||||||
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [std::mem::MaybeUninit<u8>]) -> bool {
|
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>> {
|
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