@@ -66,56 +66,53 @@ pub async fn start(config: &Configuration, tracker: Arc<core::Tracker>) -> Vec<J
6666 }
6767
6868 // Start the UDP blocks
69- match & config. udp_trackers {
70- Some ( udp_trackers) => {
71- for udp_tracker_config in udp_trackers {
72- if tracker. is_private ( ) {
73- warn ! (
74- "Could not start UDP tracker on: {} while in private mode. UDP is not safe for private trackers!" ,
75- udp_tracker_config. bind_address
76- ) ;
77- } else {
78- jobs. push ( udp_tracker:: start_job ( udp_tracker_config, tracker. clone ( ) , registar. give_form ( ) ) . await ) ;
79- }
69+ if let Some ( udp_trackers) = & config. udp_trackers {
70+ for udp_tracker_config in udp_trackers {
71+ if tracker. is_private ( ) {
72+ warn ! (
73+ "Could not start UDP tracker on: {} while in private mode. UDP is not safe for private trackers!" ,
74+ udp_tracker_config. bind_address
75+ ) ;
76+ } else {
77+ jobs. push ( udp_tracker:: start_job ( udp_tracker_config, tracker. clone ( ) , registar. give_form ( ) ) . await ) ;
8078 }
8179 }
82- None => info ! ( "No UDP blocks in configuration" ) ,
80+ } else {
81+ info ! ( "No UDP blocks in configuration" ) ;
8382 }
8483
8584 // Start the HTTP blocks
86- match & config. http_trackers {
87- Some ( http_trackers) => {
88- for http_tracker_config in http_trackers {
89- if let Some ( job) = http_tracker:: start_job (
90- http_tracker_config,
91- tracker. clone ( ) ,
92- registar. give_form ( ) ,
93- servers:: http:: Version :: V1 ,
94- )
95- . await
96- {
97- jobs. push ( job) ;
98- } ;
99- }
100- }
101- None => info ! ( "No HTTP blocks in configuration" ) ,
102- }
103-
104- // Start HTTP API
105- match & config. http_api {
106- Some ( http_api_config) => {
107- if let Some ( job) = tracker_apis:: start_job (
108- http_api_config,
85+ if let Some ( http_trackers) = & config. http_trackers {
86+ for http_tracker_config in http_trackers {
87+ if let Some ( job) = http_tracker:: start_job (
88+ http_tracker_config,
10989 tracker. clone ( ) ,
11090 registar. give_form ( ) ,
111- servers:: apis :: Version :: V1 ,
91+ servers:: http :: Version :: V1 ,
11292 )
11393 . await
11494 {
11595 jobs. push ( job) ;
11696 } ;
11797 }
118- None => info ! ( "No API block in configuration" ) ,
98+ } else {
99+ info ! ( "No HTTP blocks in configuration" ) ;
100+ }
101+
102+ // Start HTTP API
103+ if let Some ( http_api_config) = & config. http_api {
104+ if let Some ( job) = tracker_apis:: start_job (
105+ http_api_config,
106+ tracker. clone ( ) ,
107+ registar. give_form ( ) ,
108+ servers:: apis:: Version :: V1 ,
109+ )
110+ . await
111+ {
112+ jobs. push ( job) ;
113+ } ;
114+ } else {
115+ info ! ( "No API block in configuration" ) ;
119116 }
120117
121118 // Start runners to remove torrents without peers, every interval
0 commit comments