Upgrade async-tungstenite to tokio (#26193)
We're seeing panics caused by a buggy implementation of AsyncWrite that is being passed to rustls: https://github.com/rustls/rustls/issues/2316#issuecomment-2662838186 One hypothesis was that we're using (comparatively) non-standard async tools for connecting over websockets; so this attempts to make us be (comparitvely) more standard. Release Notes: - N/A
This commit is contained in:
parent
ea33d78ae4
commit
ca4cc4764b
11 changed files with 84 additions and 140 deletions
|
@ -8,6 +8,7 @@ use futures::{SinkExt as _, StreamExt as _};
|
|||
use proto::Message as _;
|
||||
use std::time::Instant;
|
||||
use std::{fmt::Debug, io};
|
||||
use zstd::zstd_safe::WriteBuf;
|
||||
|
||||
const KIB: usize = 1024;
|
||||
const MIB: usize = KIB * 1024;
|
||||
|
@ -59,7 +60,9 @@ where
|
|||
|
||||
self.encoding_buffer.clear();
|
||||
self.encoding_buffer.shrink_to(MAX_BUFFER_LEN);
|
||||
self.stream.send(WebSocketMessage::Binary(buffer)).await?;
|
||||
self.stream
|
||||
.send(WebSocketMessage::Binary(buffer.into()))
|
||||
.await?;
|
||||
}
|
||||
Message::Ping => {
|
||||
self.stream
|
||||
|
|
|
@ -1030,7 +1030,7 @@ mod tests {
|
|||
let _ = messages_ended_rx.await;
|
||||
assert!(
|
||||
server_conn
|
||||
.send(WebSocketMessage::Binary(vec![]))
|
||||
.send(WebSocketMessage::Binary(vec![].into()))
|
||||
.await
|
||||
.is_err()
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue