mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-23 16:21:06 +01:00
Fix segfault in ServerSettings::get_response_builder()
This commit is contained in:
parent
75861a21ae
commit
ed9971b212
@ -8,7 +8,6 @@ cache:
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- rust: 1.21.0
|
||||
- rust: stable
|
||||
- rust: beta
|
||||
- rust: nightly
|
||||
|
@ -1,5 +1,10 @@
|
||||
# Changes
|
||||
|
||||
## 0.5.8 (2018-05-11)
|
||||
|
||||
* Fix segfault in ServerSettings::get_response_builder()
|
||||
|
||||
|
||||
## 0.5.7 (2018-05-09)
|
||||
|
||||
* Fix http/2 payload streaming #215
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-web"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust."
|
||||
readme = "README.md"
|
||||
|
@ -8,15 +8,14 @@ use std::sync::Arc;
|
||||
use std::{fmt, mem, net};
|
||||
use time;
|
||||
|
||||
use super::KeepAlive;
|
||||
use super::channel::Node;
|
||||
use super::helpers;
|
||||
use super::shared::{SharedBytes, SharedBytesPool};
|
||||
use super::KeepAlive;
|
||||
use body::Body;
|
||||
use httpresponse::{HttpResponse, HttpResponseBuilder, HttpResponsePool};
|
||||
|
||||
/// Various server settings
|
||||
#[derive(Clone)]
|
||||
pub struct ServerSettings {
|
||||
addr: Option<net::SocketAddr>,
|
||||
secure: bool,
|
||||
@ -28,6 +27,18 @@ pub struct ServerSettings {
|
||||
unsafe impl Sync for ServerSettings {}
|
||||
unsafe impl Send for ServerSettings {}
|
||||
|
||||
impl Clone for ServerSettings {
|
||||
fn clone(&self) -> Self {
|
||||
ServerSettings {
|
||||
addr: self.addr,
|
||||
secure: self.secure,
|
||||
host: self.host.clone(),
|
||||
cpu_pool: self.cpu_pool.clone(),
|
||||
responses: HttpResponsePool::pool(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct InnerCpuPool {
|
||||
cpu_pool: UnsafeCell<Option<CpuPool>>,
|
||||
}
|
||||
@ -72,7 +83,7 @@ impl Default for ServerSettings {
|
||||
impl ServerSettings {
|
||||
/// Crate server settings instance
|
||||
pub(crate) fn new(
|
||||
addr: Option<net::SocketAddr>, host: &Option<String>, secure: bool
|
||||
addr: Option<net::SocketAddr>, host: &Option<String>, secure: bool,
|
||||
) -> ServerSettings {
|
||||
let host = if let Some(ref host) = *host {
|
||||
host.clone()
|
||||
@ -119,7 +130,7 @@ impl ServerSettings {
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn get_response_builder(
|
||||
&self, status: StatusCode
|
||||
&self, status: StatusCode,
|
||||
) -> HttpResponseBuilder {
|
||||
HttpResponsePool::get_builder(&self.responses, status)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user