fix keep-alive default name error

This commit is contained in:
xfy
2024-05-13 21:55:28 +08:00
parent 216811c4f8
commit 7ff097528c
3 changed files with 4 additions and 6 deletions

View File

@ -9,9 +9,7 @@ port = 4000
# index file name and format
index = ["index.html"]
# http keep alive timeout
keep_alive = 75
# http process max timeout
process_timeout = 15
keep_alive = 15
[[host.route]]
# route path: GET /
location = "/"

View File

@ -1,6 +1,6 @@
use crate::{
consts::{
host_index, insert_default_mimes, keep_alive_timeoutd_efault, mime_default, types_default,
host_index, insert_default_mimes, keep_alive_timeout_default, mime_default, types_default,
},
error::Result,
};
@ -30,7 +30,7 @@ pub struct SettingHost {
#[serde(default = "host_index")]
pub index: Vec<String>,
/// HTTP keep-alive timeout
#[serde(default = "keep_alive_timeoutd_efault")]
#[serde(default = "keep_alive_timeout_default")]
pub keep_alive: u16,
}

View File

@ -31,7 +31,7 @@ pub fn host_index() -> Vec<String> {
// default http keep alive timeout
pub const KEEP_ALIVE_TIMEOUTD_EFAULT: u16 = 75;
pub fn keep_alive_timeoutd_efault() -> u16 {
pub fn keep_alive_timeout_default() -> u16 {
KEEP_ALIVE_TIMEOUTD_EFAULT
}