Move the SSL client in HttpState

This commit is contained in:
Anthony Ramine 2017-04-06 18:11:20 +02:00
parent 21eafebd37
commit 949a0827e0
4 changed files with 19 additions and 17 deletions

View file

@ -27,6 +27,7 @@ use hyper::header::{Pragma, Quality, QualityItem, Referer, SetCookie};
use hyper::header::{UserAgent, q, qitem};
use hyper::method::Method;
use hyper::status::StatusCode;
use hyper_openssl::OpensslClient;
use hyper_serde::Serde;
use log;
use msg::constellation_msg::PipelineId;
@ -68,14 +69,16 @@ pub struct HttpState {
pub hsts_list: RwLock<HstsList>,
pub cookie_jar: RwLock<CookieStorage>,
pub auth_cache: RwLock<AuthCache>,
pub ssl_client: OpensslClient,
}
impl HttpState {
pub fn new() -> HttpState {
pub fn new(ssl_client: OpensslClient) -> HttpState {
HttpState {
hsts_list: RwLock::new(HstsList::new()),
cookie_jar: RwLock::new(CookieStorage::new(150)),
auth_cache: RwLock::new(AuthCache::new()),
ssl_client: ssl_client,
}
}
}