diff options
| author | salmonik <salmonik@tuta.io> | 2026-08-24 15:27:06 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-08-24 15:27:06 +0200 |
| commit | 8218fd584e4053848738a310258893e14c4ee10e (patch) | |
| tree | 2c92997ba0b6aa260fe72c88190f5f8b590457cb /src/bin/server/handler.rs | |
| parent | TLS transport and games framework on client and server (diff) | |
| download | zagan-bet-8218fd584e4053848738a310258893e14c4ee10e.tar.gz zagan-bet-8218fd584e4053848738a310258893e14c4ee10e.zip | |
TOFU host trust: SPKI fingerprint pinning, tests, forget-host
Diffstat (limited to 'src/bin/server/handler.rs')
| -rw-r--r-- | src/bin/server/handler.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bin/server/handler.rs b/src/bin/server/handler.rs index 867910e..48e9d3a 100644 --- a/src/bin/server/handler.rs +++ b/src/bin/server/handler.rs | |||
| @@ -8,7 +8,11 @@ use std::io::{BufRead, BufReader, Write}; | |||
| 8 | use std::net::TcpStream; | 8 | use std::net::TcpStream; |
| 9 | use std::sync::Mutex; | 9 | use std::sync::Mutex; |
| 10 | 10 | ||
| 11 | static DB_CONN: Lazy<Mutex<Connection>> = Lazy::new(|| Mutex::new(database::init_db())); | 11 | static DB_CONN: Lazy<Mutex<Connection>> = Lazy::new(|| { |
| 12 | let conn = Connection::open(std::env::var("SERVER_DB").unwrap_or_else(|_| "server.db".to_string())).unwrap(); | ||
| 13 | database::init_db(&conn); | ||
| 14 | Mutex::new(conn) | ||
| 15 | }); | ||
| 12 | 16 | ||
| 13 | #[allow(dead_code)] | 17 | #[allow(dead_code)] |
| 14 | pub fn handle_client(stream: TcpStream) { | 18 | pub fn handle_client(stream: TcpStream) { |
