Remove test prints.

This commit is contained in:
yukirij 2024-08-16 15:13:40 -07:00
parent 559bee47b8
commit edd7158ca2
2 changed files with 7 additions and 13 deletions

View File

@ -175,10 +175,12 @@ async fn main()
match server.bind("0.0.0.0:38612").await { match server.bind("0.0.0.0:38612").await {
Ok(_) => { Ok(_) => {
println!("Listener bind successful."); println!("Listener bind successful.");
while server.accept(handle_http, HttpServiceArgs { tokio::spawn(async move {
bus:bus.connect().unwrap(), while server.accept(handle_http, HttpServiceArgs {
cache:cache.clone(), bus:bus.connect().unwrap(),
}).await.is_ok() { } cache:cache.clone(),
}).await.is_ok() { }
});
} }
Err(_) => { Err(_) => {
println!("error: failed to bind port 38612."); println!("error: failed to bind port 38612.");
@ -190,5 +192,5 @@ async fn main()
} }
} }
//std::thread::park(); loop { tokio::time::sleep(tokio::time::Duration::from_secs(10)).await; }
} }

View File

@ -112,29 +112,21 @@ impl Server for TlsServer {
Fut: std::future::Future<Output = Result<(),()>> + Send + 'static, Fut: std::future::Future<Output = Result<(),()>> + Send + 'static,
Args: Send + 'static Args: Send + 'static
{ {
println!("A");
match &self.listener { match &self.listener {
Some(listener) => { Some(listener) => {
println!("B");
if let Ok((socket, client_addr)) = listener.accept().await { if let Ok((socket, client_addr)) = listener.accept().await {
let acceptor = LazyConfigAcceptor::new(Acceptor::default(), socket); let acceptor = LazyConfigAcceptor::new(Acceptor::default(), socket);
let certificates = self.certificates.clone(); let certificates = self.certificates.clone();
println!("C");
Ok(tokio::spawn(async move { Ok(tokio::spawn(async move {
println!("D");
match acceptor.await { match acceptor.await {
Ok(hs) => { Ok(hs) => {
println!("E");
let hello = hs.client_hello(); let hello = hs.client_hello();
if let Some(server_name) = hello.server_name() { if let Some(server_name) = hello.server_name() {
println!("F");
match Self::get_server_config(certificates, server_name).await { match Self::get_server_config(certificates, server_name).await {
Some(server_config) => { Some(server_config) => {
println!("G");
match hs.into_stream(server_config).await { match hs.into_stream(server_config).await {
Ok(tlsstream) => { Ok(tlsstream) => {
println!("H");
callback(Self::Stream { stream:tlsstream }, client_addr, args).await callback(Self::Stream { stream:tlsstream }, client_addr, args).await
} }
Err(_) => Err(()) Err(_) => Err(())