mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-30 18:42:52 +01:00
Handle socket read disconnect
This commit is contained in:
parent
3f196f469d
commit
7f12b754e9
@ -1,5 +1,12 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.2.1] - 2019-05-2
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Handle socket read disconnect
|
||||||
|
|
||||||
|
|
||||||
## [0.2.0] - 2019-05-12
|
## [0.2.0] - 2019-05-12
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "actix-http"
|
name = "actix-http"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
description = "Actix http primitives"
|
description = "Actix http primitives"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@ -47,7 +47,7 @@ secure-cookies = ["ring"]
|
|||||||
actix-service = "0.4.0"
|
actix-service = "0.4.0"
|
||||||
actix-codec = "0.1.2"
|
actix-codec = "0.1.2"
|
||||||
actix-connect = "0.2.0"
|
actix-connect = "0.2.0"
|
||||||
actix-utils = "0.4.0"
|
actix-utils = "0.4.1"
|
||||||
actix-server-config = "0.1.1"
|
actix-server-config = "0.1.1"
|
||||||
actix-threadpool = "0.1.0"
|
actix-threadpool = "0.1.0"
|
||||||
|
|
||||||
|
@ -583,6 +583,9 @@ where
|
|||||||
self.ka_timer = Some(Delay::new(interval));
|
self.ka_timer = Some(Delay::new(interval));
|
||||||
} else {
|
} else {
|
||||||
self.flags.insert(Flags::READ_DISCONNECT);
|
self.flags.insert(Flags::READ_DISCONNECT);
|
||||||
|
if let Some(mut payload) = self.payload.take() {
|
||||||
|
payload.set_error(PayloadError::Incomplete(None));
|
||||||
|
}
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -694,7 +697,10 @@ where
|
|||||||
if let Some(true) =
|
if let Some(true) =
|
||||||
read_available(&mut inner.io, &mut inner.read_buf)?
|
read_available(&mut inner.io, &mut inner.read_buf)?
|
||||||
{
|
{
|
||||||
inner.flags.insert(Flags::READ_DISCONNECT)
|
inner.flags.insert(Flags::READ_DISCONNECT);
|
||||||
|
if let Some(mut payload) = inner.payload.take() {
|
||||||
|
payload.feed_eof();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user