mirror of https://github.com/fafhrd91/actix-web
Merge branch 'master' into make_json_config_send
This commit is contained in:
commit
a8db746a19
|
@ -101,7 +101,7 @@ rustls = { version = "^0.15", optional = true }
|
|||
[dev-dependencies]
|
||||
actix-http = { version = "0.2.0", features=["ssl", "brotli", "flate2-zlib"] }
|
||||
actix-http-test = { version = "0.2.0", features=["ssl"] }
|
||||
actix-files = { version = "0.1.0-betsa.1" }
|
||||
actix-files = { version = "0.1.0-beta.4" }
|
||||
rand = "0.6"
|
||||
env_logger = "0.6"
|
||||
serde_derive = "1.0"
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# Changes
|
||||
|
||||
## [0.1.0-beta.4] - 2019-05-12
|
||||
|
||||
* Update actix-web to beta.4
|
||||
|
||||
## [0.1.0-beta.1] - 2019-04-20
|
||||
|
||||
* Update actix-web to beta.1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-files"
|
||||
version = "0.1.0-betsa.1"
|
||||
version = "0.1.0-beta.4"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Static files support for actix web."
|
||||
readme = "README.md"
|
||||
|
@ -18,7 +18,7 @@ name = "actix_files"
|
|||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-beta.1"
|
||||
actix-web = "1.0.0-beta.4"
|
||||
actix-service = "0.4.0"
|
||||
bitflags = "1"
|
||||
bytes = "0.4"
|
||||
|
@ -31,4 +31,4 @@ percent-encoding = "1.0"
|
|||
v_htmlescape = "0.4"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-web = { version = "1.0.0-beta.1", features=["ssl"] }
|
||||
actix-web = { version = "1.0.0-beta.4", features=["ssl"] }
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
# Changes
|
||||
|
||||
## [0.1.0-beta.4] - 2019-05-12
|
||||
|
||||
* Handle cancellation of uploads #834 #736
|
||||
|
||||
* Upgrade to actix-web 1.0.0-beta.4
|
||||
|
||||
## [0.1.0-beta.1] - 2019-04-21
|
||||
|
||||
* Do not support nested multipart
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-multipart"
|
||||
version = "0.1.0-beta.1"
|
||||
version = "0.1.0-beta.4"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Multipart support for actix web framework."
|
||||
readme = "README.md"
|
||||
|
@ -18,7 +18,7 @@ name = "actix_multipart"
|
|||
path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-beta.1"
|
||||
actix-web = "1.0.0-beta.4"
|
||||
actix-service = "0.4.0"
|
||||
bytes = "0.4"
|
||||
derive_more = "0.14"
|
||||
|
|
|
@ -28,6 +28,9 @@ pub enum MultipartError {
|
|||
/// Payload error
|
||||
#[display(fmt = "{}", _0)]
|
||||
Payload(PayloadError),
|
||||
/// Not consumed
|
||||
#[display(fmt = "Multipart stream is not consumed")]
|
||||
NotConsumed,
|
||||
}
|
||||
|
||||
/// Return `BadRequest` for `MultipartError`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//! Multipart payload support
|
||||
use std::cell::{RefCell, UnsafeCell};
|
||||
use std::cell::{Cell, RefCell, UnsafeCell};
|
||||
use std::marker::PhantomData;
|
||||
use std::rc::Rc;
|
||||
use std::{cmp, fmt};
|
||||
|
@ -116,6 +116,8 @@ impl Stream for Multipart {
|
|||
payload.poll_stream()?;
|
||||
}
|
||||
inner.poll(&self.safety)
|
||||
} else if !self.safety.is_clean() {
|
||||
Err(MultipartError::NotConsumed)
|
||||
} else {
|
||||
Ok(Async::NotReady)
|
||||
}
|
||||
|
@ -415,6 +417,8 @@ impl Stream for Field {
|
|||
}
|
||||
|
||||
inner.poll(&self.safety)
|
||||
} else if !self.safety.is_clean() {
|
||||
return Err(MultipartError::NotConsumed);
|
||||
} else {
|
||||
Ok(Async::NotReady)
|
||||
}
|
||||
|
@ -655,6 +659,7 @@ struct Safety {
|
|||
task: Option<Task>,
|
||||
level: usize,
|
||||
payload: Rc<PhantomData<bool>>,
|
||||
clean: Rc<Cell<bool>>,
|
||||
}
|
||||
|
||||
impl Safety {
|
||||
|
@ -663,12 +668,17 @@ impl Safety {
|
|||
Safety {
|
||||
task: None,
|
||||
level: Rc::strong_count(&payload),
|
||||
clean: Rc::new(Cell::new(true)),
|
||||
payload,
|
||||
}
|
||||
}
|
||||
|
||||
fn current(&self) -> bool {
|
||||
Rc::strong_count(&self.payload) == self.level
|
||||
Rc::strong_count(&self.payload) == self.level && self.clean.get()
|
||||
}
|
||||
|
||||
fn is_clean(&self) -> bool {
|
||||
self.clean.get()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -678,6 +688,7 @@ impl Clone for Safety {
|
|||
Safety {
|
||||
task: Some(current_task()),
|
||||
level: Rc::strong_count(&payload),
|
||||
clean: self.clean.clone(),
|
||||
payload,
|
||||
}
|
||||
}
|
||||
|
@ -687,7 +698,7 @@ impl Drop for Safety {
|
|||
fn drop(&mut self) {
|
||||
// parent task is dead
|
||||
if Rc::strong_count(&self.payload) != self.level {
|
||||
panic!("Safety get dropped but it is not from top-most task");
|
||||
self.clean.set(true);
|
||||
}
|
||||
if let Some(task) = self.task.take() {
|
||||
task.notify()
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# Changes
|
||||
|
||||
## [0.1.0-beta.4] - 2019-05-12
|
||||
|
||||
* Use actix-web 1.0.0-beta.4
|
||||
|
||||
## [0.1.0-beta.2] - 2019-04-28
|
||||
|
||||
* Add helper trait `UserSession` which allows to get session for ServiceRequest and HttpRequest
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-session"
|
||||
version = "0.1.0-beta.2"
|
||||
version = "0.1.0-beta.4"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Session for actix web framework."
|
||||
readme = "README.md"
|
||||
|
@ -24,7 +24,7 @@ default = ["cookie-session"]
|
|||
cookie-session = ["actix-web/secure-cookies"]
|
||||
|
||||
[dependencies]
|
||||
actix-web = "1.0.0-beta.2"
|
||||
actix-web = "1.0.0-beta.4"
|
||||
actix-service = "0.4.0"
|
||||
bytes = "0.4"
|
||||
derive_more = "0.14"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "actix-web-actors"
|
||||
version = "1.0.0-alpha.3"
|
||||
version = "1.0.0-beta.4"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Actix actors support for actix web framework."
|
||||
readme = "README.md"
|
||||
|
@ -19,7 +19,7 @@ path = "src/lib.rs"
|
|||
|
||||
[dependencies]
|
||||
actix = "0.8.0"
|
||||
actix-web = "1.0.0-beta.1"
|
||||
actix-web = "1.0.0-beta.4"
|
||||
actix-http = "0.2.0"
|
||||
actix-codec = "0.1.2"
|
||||
bytes = "0.4"
|
||||
|
|
Loading…
Reference in New Issue