mirror of https://github.com/fafhrd91/actix-web
Compare commits
2 Commits
1a980855f0
...
d0fa09eb83
| Author | SHA1 | Date |
|---|---|---|
|
|
d0fa09eb83 | |
|
|
75822de4ea |
|
|
@ -1082,9 +1082,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.20.11"
|
||||
version = "0.23.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
|
||||
checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"darling_macro",
|
||||
|
|
@ -1092,11 +1092,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "darling_core"
|
||||
version = "0.20.11"
|
||||
version = "0.23.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
|
||||
checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0"
|
||||
dependencies = [
|
||||
"fnv",
|
||||
"ident_case",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -1106,9 +1105,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "darling_macro"
|
||||
version = "0.20.11"
|
||||
version = "0.23.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
|
||||
checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"quote",
|
||||
|
|
|
|||
|
|
@ -366,10 +366,9 @@ where
|
|||
io.poll_flush(cx)
|
||||
}
|
||||
|
||||
fn enter_linger(mut self: Pin<&mut Self>) {
|
||||
let this = self.as_mut().project();
|
||||
this.flags.remove(Flags::KEEP_ALIVE);
|
||||
this.flags.insert(Flags::LINGER | Flags::FINISHED);
|
||||
fn enter_linger(flags: &mut Flags) {
|
||||
flags.remove(Flags::KEEP_ALIVE);
|
||||
flags.insert(Flags::LINGER | Flags::FINISHED);
|
||||
}
|
||||
|
||||
fn ensure_linger_timer(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> bool {
|
||||
|
|
@ -464,23 +463,19 @@ where
|
|||
let size = self.as_mut().send_response_inner(res, &body)?;
|
||||
match size {
|
||||
BodySize::None | BodySize::Sized(0) => {
|
||||
let this = self.as_mut().project();
|
||||
let mut this = self.as_mut().project();
|
||||
|
||||
if close_after_response {
|
||||
if this.config.client_disconnect_deadline().is_some() {
|
||||
drop(this);
|
||||
self.as_mut().enter_linger();
|
||||
Self::enter_linger(this.flags);
|
||||
} else {
|
||||
self.as_mut()
|
||||
.project()
|
||||
.flags
|
||||
.insert(Flags::SHUTDOWN | Flags::FINISHED);
|
||||
this.flags.insert(Flags::SHUTDOWN | Flags::FINISHED);
|
||||
}
|
||||
} else {
|
||||
this.flags.insert(Flags::FINISHED);
|
||||
}
|
||||
|
||||
self.as_mut().project().state.set(State::None);
|
||||
this.state.set(State::None);
|
||||
}
|
||||
_ => self
|
||||
.as_mut()
|
||||
|
|
@ -509,23 +504,19 @@ where
|
|||
let size = self.as_mut().send_response_inner(res, &body)?;
|
||||
match size {
|
||||
BodySize::None | BodySize::Sized(0) => {
|
||||
let this = self.as_mut().project();
|
||||
let mut this = self.as_mut().project();
|
||||
|
||||
if close_after_response {
|
||||
if this.config.client_disconnect_deadline().is_some() {
|
||||
drop(this);
|
||||
self.as_mut().enter_linger();
|
||||
Self::enter_linger(this.flags);
|
||||
} else {
|
||||
self.as_mut()
|
||||
.project()
|
||||
.flags
|
||||
.insert(Flags::SHUTDOWN | Flags::FINISHED);
|
||||
this.flags.insert(Flags::SHUTDOWN | Flags::FINISHED);
|
||||
}
|
||||
} else {
|
||||
this.flags.insert(Flags::FINISHED);
|
||||
}
|
||||
|
||||
self.as_mut().project().state.set(State::None);
|
||||
this.state.set(State::None);
|
||||
}
|
||||
_ => self
|
||||
.as_mut()
|
||||
|
|
@ -646,13 +637,9 @@ where
|
|||
|
||||
if not_pipelined && close_after_response {
|
||||
if this.config.client_disconnect_deadline().is_some() {
|
||||
drop(this);
|
||||
self.as_mut().enter_linger();
|
||||
Self::enter_linger(this.flags);
|
||||
} else {
|
||||
self.as_mut()
|
||||
.project()
|
||||
.flags
|
||||
.insert(Flags::SHUTDOWN | Flags::FINISHED);
|
||||
this.flags.insert(Flags::SHUTDOWN | Flags::FINISHED);
|
||||
}
|
||||
} else {
|
||||
this.flags.insert(Flags::FINISHED);
|
||||
|
|
@ -708,13 +695,9 @@ where
|
|||
|
||||
if not_pipelined && close_after_response {
|
||||
if this.config.client_disconnect_deadline().is_some() {
|
||||
drop(this);
|
||||
self.as_mut().enter_linger();
|
||||
Self::enter_linger(this.flags);
|
||||
} else {
|
||||
self.as_mut()
|
||||
.project()
|
||||
.flags
|
||||
.insert(Flags::SHUTDOWN | Flags::FINISHED);
|
||||
this.flags.insert(Flags::SHUTDOWN | Flags::FINISHED);
|
||||
}
|
||||
} else {
|
||||
this.flags.insert(Flags::FINISHED);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
## 0.8.0
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.88.
|
||||
- Update `darling` dependency to `0.23`.
|
||||
|
||||
## 0.7.0
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ proc-macro = true
|
|||
|
||||
[dependencies]
|
||||
bytesize = "2"
|
||||
darling = "0.20"
|
||||
darling = "0.23"
|
||||
proc-macro2 = "1"
|
||||
quote = "1"
|
||||
syn = "2"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error: Unknown literal value `no`
|
||||
error: Unknown value: `no`. Available values: `deny`, `ignore`, `replace`
|
||||
--> tests/trybuild/deny-parse-fail.rs:4:31
|
||||
|
|
||||
4 | #[multipart(duplicate_field = "no")]
|
||||
|
|
|
|||
|
|
@ -513,20 +513,17 @@ pub(crate) fn with_methods(input: TokenStream) -> TokenStream {
|
|||
Err(err) => return input_and_compile_error(input, err),
|
||||
};
|
||||
|
||||
let (methods, others) = ast
|
||||
.attrs
|
||||
.into_iter()
|
||||
.map(|attr| match MethodType::from_path(attr.path()) {
|
||||
Ok(method) => Ok((method, attr)),
|
||||
Err(_) => Err(attr),
|
||||
})
|
||||
.partition::<Vec<_>, _>(Result::is_ok);
|
||||
let mut methods = Vec::new();
|
||||
|
||||
ast.attrs = others.into_iter().map(Result::unwrap_err).collect();
|
||||
for attr in std::mem::take(&mut ast.attrs) {
|
||||
match MethodType::from_path(attr.path()) {
|
||||
Ok(method) => methods.push((method, attr)),
|
||||
Err(_) => ast.attrs.push(attr),
|
||||
}
|
||||
}
|
||||
|
||||
let methods = match methods
|
||||
.into_iter()
|
||||
.map(Result::unwrap)
|
||||
.map(|(method, attr)| {
|
||||
attr.parse_args()
|
||||
.and_then(|args| Args::new(args, Some(method)))
|
||||
|
|
|
|||
Loading…
Reference in New Issue