Skip to content

Commit

Permalink
box enum variant
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrishn7 committed Apr 2, 2024
1 parent 3a4cd94 commit 266cc9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/kiwi/src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn tls_acceptor(cert: impl AsRef<Path>, key: impl AsRef<Path>) -> anyhow::Re

pub enum MaybeTlsStream<S> {
Plain(S),
Tls(TlsStream<S>),
Tls(Box<TlsStream<S>>),
}

impl<S: AsyncRead + AsyncWrite + Unpin> AsyncRead for MaybeTlsStream<S> {
Expand Down
4 changes: 3 additions & 1 deletion src/kiwi/src/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ where
tokio::spawn(async move {
let io = if let Some(acceptor) = acceptor {
match acceptor.accept(stream).await {
Ok(stream) => hyper_util::rt::TokioIo::new(MaybeTlsStream::Tls(stream)),
Ok(stream) => {
hyper_util::rt::TokioIo::new(MaybeTlsStream::Tls(Box::new(stream)))

Check warning on line 61 in src/kiwi/src/ws.rs

View check run for this annotation

Codecov / codecov/patch

src/kiwi/src/ws.rs#L49-L61

Added lines #L49 - L61 were not covered by tests
}
Err(e) => {
tracing::error!(addr = ?addr, "Failed to accept TLS connection: {}", e);
return;

Check warning on line 65 in src/kiwi/src/ws.rs

View check run for this annotation

Codecov / codecov/patch

src/kiwi/src/ws.rs#L63-L65

Added lines #L63 - L65 were not covered by tests
Expand Down

0 comments on commit 266cc9e

Please sign in to comment.