Increase dependency specificity for async-tls #18
|
@ -11,7 +11,7 @@ repository = "https://tulpa.dev/cadey/maj"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
async-std = { version = "1.6", optional = true }
|
async-std = { version = "1.6", optional = true }
|
||||||
async-tls = { default-features = false, optional = true, version = "0" }
|
async-tls = { default-features = false, optional = true, version = "=0.10.0" }
|
||||||
async-trait = { version = "0", optional = true }
|
async-trait = { version = "0", optional = true }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
mime_guess = "2.0"
|
mime_guess = "2.0"
|
||||||
|
|
|
@ -51,10 +51,9 @@ pub async fn serve(
|
||||||
) -> Result
|
) -> Result
|
||||||
where
|
where
|
||||||
{
|
{
|
||||||
let cfg = Arc::new(cfg);
|
|
||||||
let listener = TcpListener::bind(&format!("{}:{}", host, port)).await?;
|
let listener = TcpListener::bind(&format!("{}:{}", host, port)).await?;
|
||||||
let mut incoming = listener.incoming();
|
let mut incoming = listener.incoming();
|
||||||
let acceptor = Arc::new(TlsAcceptor::from(cfg.clone()));
|
let acceptor = Arc::new(TlsAcceptor::from(cfg));
|
||||||
while let Some(Ok(stream)) = incoming.next().await {
|
while let Some(Ok(stream)) = incoming.next().await {
|
||||||
let h = h.clone();
|
let h = h.clone();
|
||||||
let acceptor = acceptor.clone();
|
let acceptor = acceptor.clone();
|
||||||
|
|
Loading…
Reference in New Issue