Skip to content

Commit

Permalink
Fix segfault in ServerSettings::get_response_builder()
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed May 12, 2018
1 parent 487a713 commit 9306631
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes

## 0.6.4 (2018-05-11)

* Fix segfault in ServerSettings::get_response_builder()


## 0.6.3 (2018-05-10)

* Add `Router::with_async()` method for async handler registration.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "actix-web"
version = "0.6.3"
version = "0.6.4"
authors = ["Nikolay Kim <[email protected]>"]
description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust."
readme = "README.md"
Expand Down
13 changes: 12 additions & 1 deletion src/server/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use body::Body;
use httpresponse::{HttpResponse, HttpResponseBuilder, HttpResponsePool};

/// Various server settings
#[derive(Clone)]
pub struct ServerSettings {
addr: Option<net::SocketAddr>,
secure: bool,
Expand All @@ -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>>,
}
Expand Down

0 comments on commit 9306631

Please sign in to comment.