summaryrefslogtreecommitdiffstats
path: root/src/bin/server
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bin/server/args.rs5
-rw-r--r--src/bin/server/main.rs6
-rw-r--r--src/bin/server/tls.rs5
3 files changed, 5 insertions, 11 deletions
diff --git a/src/bin/server/args.rs b/src/bin/server/args.rs
index 1babd1d..1db2a28 100644
--- a/src/bin/server/args.rs
+++ b/src/bin/server/args.rs
@@ -31,10 +31,7 @@ pub fn parse_args() -> Args {
31 if i + 1 < args.len() { 31 if i + 1 < args.len() {
32 ip = args[i + 1].clone(); 32 ip = args[i + 1].clone();
33 if ip != "127.0.0.1" && ip != "0.0.0.0" { 33 if ip != "127.0.0.1" && ip != "0.0.0.0" {
34 eprintln!( 34 eprintln!("Invalid IP address: {}. Must be 127.0.0.1 or 0.0.0.0", ip);
35 "Invalid IP address: {}. Must be 127.0.0.1 or 0.0.0.0",
36 ip
37 );
38 std::process::exit(1); 35 std::process::exit(1);
39 } 36 }
40 i += 2; 37 i += 2;
diff --git a/src/bin/server/main.rs b/src/bin/server/main.rs
index 85e3134..f42574d 100644
--- a/src/bin/server/main.rs
+++ b/src/bin/server/main.rs
@@ -40,9 +40,9 @@ fn main() {
40 let db_path = std::env::var("SERVER_DB").unwrap_or_else(|_| "server.db".to_string()); 40 let db_path = std::env::var("SERVER_DB").unwrap_or_else(|_| "server.db".to_string());
41 match zagan_bet::server::core::recover_orphaned_reservations(&db_path) { 41 match zagan_bet::server::core::recover_orphaned_reservations(&db_path) {
42 Ok(0) => {} 42 Ok(0) => {}
43 Ok(count) => println!( 43 Ok(count) => {
44 "Settled {count} orphaned reservation(s) as abandoned after a restart" 44 println!("Settled {count} orphaned reservation(s) as abandoned after a restart")
45 ), 45 }
46 Err(error) => { 46 Err(error) => {
47 eprintln!("Failed to settle orphaned reservations in {db_path}: {error}"); 47 eprintln!("Failed to settle orphaned reservations in {db_path}: {error}");
48 std::process::exit(1); 48 std::process::exit(1);
diff --git a/src/bin/server/tls.rs b/src/bin/server/tls.rs
index 5d84589..420b5b4 100644
--- a/src/bin/server/tls.rs
+++ b/src/bin/server/tls.rs
@@ -80,10 +80,7 @@ impl TlsStream {
80 80
81 /// Read timeout for the socket. The connection loop uses a short one so it 81 /// Read timeout for the socket. The connection loop uses a short one so it
82 /// can advance crash rounds while no request is in flight. 82 /// can advance crash rounds while no request is in flight.
83 pub fn set_read_timeout( 83 pub fn set_read_timeout(&self, duration: Option<std::time::Duration>) -> std::io::Result<()> {
84 &self,
85 duration: Option<std::time::Duration>,
86 ) -> std::io::Result<()> {
87 self.stream.get_ref().set_read_timeout(duration) 84 self.stream.get_ref().set_read_timeout(duration)
88 } 85 }
89} 86}