Skip to content

Commit

Permalink
Merge pull request #254 from c410-f3r/misc
Browse files Browse the repository at this point in the history
Fix feature detection
  • Loading branch information
c410-f3r authored Oct 25, 2024
2 parents dd2c2e7 + 4f5065d commit b2a6d93
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions wtx/src/http/server_framework/tokio.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
use tokio::{
io::WriteHalf,
net::{tcp::OwnedWriteHalf, TcpStream},
};
use tokio_rustls::server::TlsStream;

use crate::{
http::{
server_framework::{
Expand All @@ -13,9 +7,9 @@ use crate::{
},
http2::{Http2Buffer, ServerStreamTokio},
misc::Rng,
web_socket::WebSocketError,
};
use std::sync::Arc;
use tokio::net::{tcp::OwnedWriteHalf, TcpStream};

impl<CA, CAC, E, P, RA, RAC, REQM, RESM> ServerFramework<CA, CAC, E, P, RA, RAC, REQM, RESM>
where
Expand Down Expand Up @@ -90,21 +84,28 @@ where
.await
}

#[inline]
async fn manual_tokio(
_: CA,
_: (impl Fn() -> RA::Init, Arc<Router<CA, E, P, RA, REQM, RESM>>),
_: Headers,
_: ServerStreamTokio<Http2Buffer, OwnedWriteHalf, false>,
) -> Result<(), E> {
Err(E::from(crate::Error::WebSocketError(WebSocketError::ConnectionClosed)))
Err(E::from(crate::Error::ClosedConnection))
}

#[cfg(feature = "tokio-rustls")]
#[inline]
async fn manual_tokio_rustls(
_: CA,
_: (impl Fn() -> RA::Init, Arc<Router<CA, E, P, RA, REQM, RESM>>),
_: Headers,
_: ServerStreamTokio<Http2Buffer, WriteHalf<TlsStream<TcpStream>>, false>,
_: ServerStreamTokio<
Http2Buffer,
tokio::io::WriteHalf<tokio_rustls::server::TlsStream<TcpStream>>,
false,
>,
) -> Result<(), E> {
Err(E::from(crate::Error::WebSocketError(WebSocketError::ConnectionClosed)))
Err(E::from(crate::Error::ClosedConnection))
}
}

0 comments on commit b2a6d93

Please sign in to comment.