Skip to content
Snippets Groups Projects
Commit 888a28d5 authored by codecraft's avatar codecraft :crocodile:
Browse files

Removing unnecessary function `write_unencrypted` due to replacement

with generic write on response. Removing unnecessary imports
parent 54277faa
No related branches found
No related tags found
1 merge request!1Initial feature merge
use std::io::Result;
use tokio::{io::{AsyncWriteExt, AsyncRead, AsyncWrite}, net::TcpStream};
use tokio::io::{AsyncWriteExt, AsyncRead, AsyncWrite};
use crate::handling::{methods::Method, request::Request, response::Status};
......@@ -37,10 +37,4 @@ impl Response {
stream.write_all(&resp).await?;
Ok(())
}
pub async fn write_unencrypted(self, mut stream: TcpStream) -> Result<()> {
let resp = self.build(None);
stream.write_all(&resp).await?;
Ok(())
}
}
use std::{thread::available_parallelism};
use std::thread::available_parallelism;
use tokio::{
net::TcpListener,
......@@ -6,12 +6,16 @@ use tokio::{
signal::unix::{signal, SignalKind, Signal},
};
#[cfg(feature = "secure")]
use tokio_native_tls::{native_tls::{Identity, self}, TlsAcceptor};
use crate::{
handlers::handler::handle_connection,
handling::{routes::{Route, Uri}, response::{Response, Status}},
handling::routes::{Route, Uri},
};
#[cfg(feature = "secure")]
use crate::handling::response::{Response, Status};
#[derive(Clone)]
/// Represnts a [MountPoint] that can be mounted in the config
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment