cargo fmt :/
This commit is contained in:
parent
37769d6536
commit
39885844a2
4 changed files with 12 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
|||
mod server;
|
||||
mod mime;
|
||||
mod server;
|
||||
use std::env;
|
||||
|
||||
fn help() {
|
||||
|
|
|
@ -9,7 +9,7 @@ pub fn get_mime_type(extension: &OsStr) -> &'static str {
|
|||
Some(ext_str) => ext_str,
|
||||
None => {
|
||||
return default_mime_type();
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
match ext_str {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::mime;
|
||||
use crate::server::response;
|
||||
use crate::server::ServerConfig;
|
||||
use crate::mime;
|
||||
use openssl::ssl::SslStream;
|
||||
use std::fs::File;
|
||||
use std::io::{copy, BufReader, BufWriter};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use nix::unistd;
|
||||
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
|
||||
use std::net::{SocketAddr, TcpListener};
|
||||
use std::path::PathBuf;
|
||||
|
@ -5,7 +6,6 @@ use std::sync::Arc;
|
|||
use std::thread;
|
||||
use std::vec::Vec;
|
||||
use url::Url;
|
||||
use nix::unistd;
|
||||
|
||||
pub mod handler;
|
||||
pub mod response;
|
||||
|
@ -96,13 +96,17 @@ impl Server {
|
|||
}
|
||||
|
||||
match unistd::setgid(self.config.group) {
|
||||
Ok(_) => {},
|
||||
Err(e) => {panic!(e);},
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
panic!(e);
|
||||
}
|
||||
};
|
||||
|
||||
match unistd::setuid(self.config.user) {
|
||||
Ok(_) => {},
|
||||
Err(e) => {panic!(e);},
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
panic!(e);
|
||||
}
|
||||
};
|
||||
|
||||
for stream in listener.incoming() {
|
||||
|
|
Loading…
Reference in a new issue