🐛 bug: fix compile bugs for tests
							parent
							
								
									b21f8a7c50
								
							
						
					
					
						commit
						1a775622cf
					
				| 
						 | 
				
			
			@ -1228,6 +1228,7 @@ name = "ptth_multi_call_server"
 | 
			
		|||
version = "0.1.0"
 | 
			
		||||
dependencies = [
 | 
			
		||||
 "anyhow",
 | 
			
		||||
 "ctrlc",
 | 
			
		||||
 "ptth_file_server",
 | 
			
		||||
 "ptth_server",
 | 
			
		||||
 "quic_demo",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,7 @@ license = "AGPL-3.0"
 | 
			
		|||
 | 
			
		||||
[dependencies]
 | 
			
		||||
anyhow = "1.0.38"
 | 
			
		||||
ctrlc = "3.2.1"
 | 
			
		||||
ptth_file_server = { path = "../ptth_file_server_bin" }
 | 
			
		||||
ptth_server = { path = "../ptth_server" }
 | 
			
		||||
quic_demo = { path = "../../prototypes/quic_demo" }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,8 @@ use std::{
 | 
			
		|||
	iter::FromIterator,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
use tokio::sync::watch;
 | 
			
		||||
 | 
			
		||||
#[derive (Clone, Copy, Debug, PartialEq)]
 | 
			
		||||
enum Subcommand {
 | 
			
		||||
	PtthServer,
 | 
			
		||||
| 
						 | 
				
			
			@ -20,7 +22,17 @@ async fn main () -> anyhow::Result <()> {
 | 
			
		|||
	match subcommand {
 | 
			
		||||
		Subcommand::PtthServer => ptth_server::executable::main (&args).await,
 | 
			
		||||
		Subcommand::PtthFileServer => ptth_file_server::main (&args).await,
 | 
			
		||||
		Subcommand::PtthQuicEndServer => quic_demo::executable_end_server::main (&args).await,
 | 
			
		||||
		Subcommand::PtthQuicEndServer => {
 | 
			
		||||
			let (shutdown_tx, shutdown_rx) = watch::channel (false);
 | 
			
		||||
			
 | 
			
		||||
			ctrlc::set_handler (move || {
 | 
			
		||||
				shutdown_tx.send (true).expect ("Couldn't forward Ctrl+C signal");
 | 
			
		||||
			})?;
 | 
			
		||||
			tracing::trace! ("Set Ctrl+C handler");
 | 
			
		||||
			quic_demo::executable_end_server::main (&args, Some (shutdown_rx)).await?;
 | 
			
		||||
			
 | 
			
		||||
			Ok (())
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,8 +79,12 @@ impl P2Client {
 | 
			
		|||
			let server_id = conf.server_id.clone ();
 | 
			
		||||
			let server_tcp_port = conf.server_tcp_port;
 | 
			
		||||
			
 | 
			
		||||
			let listener = TcpListener::bind (("127.0.0.1", client_tcp_port)).await?;
 | 
			
		||||
			trace! ("Accepting local TCP connections from P1 on {}", client_tcp_port);
 | 
			
		||||
			
 | 
			
		||||
			tokio::spawn (async move {
 | 
			
		||||
				forward_port (
 | 
			
		||||
					listener,
 | 
			
		||||
					connection,
 | 
			
		||||
					ForwardingParams {
 | 
			
		||||
						client_tcp_port,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue