mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-31 17:01:58 +00:00
Add implementations of prepare_uninitialized_buffer and read_buf where relevant (#1107)
* Fix #1080 * Fix browser WebSockets
This commit is contained in:
@@ -8,6 +8,7 @@ repository = "https://github.com/libp2p/rust-libp2p"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
bytes = "0.4"
|
||||
curve25519-dalek = "1"
|
||||
futures = "0.1"
|
||||
lazy_static = "1.2"
|
||||
|
@@ -335,7 +335,11 @@ impl<T: io::Write> io::Write for NoiseOutput<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: AsyncRead> AsyncRead for NoiseOutput<T> {}
|
||||
impl<T: AsyncRead> AsyncRead for NoiseOutput<T> {
|
||||
unsafe fn prepare_uninitialized_buffer(&self, _: &mut [u8]) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: AsyncWrite> AsyncWrite for NoiseOutput<T> {
|
||||
fn shutdown(&mut self) -> Poll<(), io::Error> {
|
||||
|
@@ -266,7 +266,14 @@ impl<T: io::Write> io::Write for State<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: AsyncRead> AsyncRead for State<T> {}
|
||||
impl<T: AsyncRead> AsyncRead for State<T> {
|
||||
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [u8]) -> bool {
|
||||
self.io.prepare_uninitialized_buffer(buf)
|
||||
}
|
||||
fn read_buf<B: bytes::BufMut>(&mut self, buf: &mut B) -> Poll<usize, io::Error> {
|
||||
self.io.read_buf(buf)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: AsyncWrite> AsyncWrite for State<T> {
|
||||
fn shutdown(&mut self) -> Poll<(), io::Error> {
|
||||
|
Reference in New Issue
Block a user