Skip to content

Commit

Permalink
Merge pull request #20 from CephalonRho/warp
Browse files Browse the repository at this point in the history
Reimplement server.rs with warp
  • Loading branch information
Clint.Network authored Nov 13, 2019
2 parents e5b3782 + 4fa02af commit 6439a95
Show file tree
Hide file tree
Showing 4 changed files with 318 additions and 260 deletions.
29 changes: 29 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ chashmap = "*"
plugin = "*"
tree_magic = "*"
byte-unit = "*"
snafu = "*"
bytes = "*"
#hyper = "*"
#hyper-openssl = "*"

Expand Down
23 changes: 16 additions & 7 deletions src/configuration.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::net::Ipv4Addr;
use std::net::{Ipv4Addr, IpAddr};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Configuration {
Expand All @@ -7,14 +7,15 @@ pub struct Configuration {
pub persistence: Persistence,
pub encryption: Encryption,
pub webui: WebUI,
pub store: Store
pub store: Store,
pub http: Http
}

impl Configuration {
pub fn default() -> Configuration {
Configuration {
default: Base {
bind_address: Ipv4Addr::LOCALHOST.to_string(),
bind_address: IpAddr::from(Ipv4Addr::LOCALHOST),
port: 7021, // TODO: change after implementing SSL
port_ssl: 7021,
use_ssl: false,
Expand All @@ -38,6 +39,9 @@ impl Configuration {
store: Store {
max_limit: 7340032
},
http: Http {
request_size_limit: 8388608
},
}
}

Expand All @@ -48,9 +52,9 @@ impl Configuration {

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Base {
pub bind_address: String,
pub port: i32,
pub port_ssl: i32,
pub bind_address: IpAddr,
pub port: u16,
pub port_ssl: u16,
pub use_ssl: bool,
}

Expand Down Expand Up @@ -80,7 +84,12 @@ pub struct WebUI {

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Store {
pub max_limit: i32
pub max_limit: u64
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Http {
pub request_size_limit: u64
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
Loading

0 comments on commit 6439a95

Please sign in to comment.