1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-02 13:29:24 +00:00

Handle socket read disconnect

This commit is contained in:
Nikolay Kim 2019-05-25 03:07:40 -07:00
parent 3f196f469d
commit 7f12b754e9
3 changed files with 16 additions and 3 deletions

View file

@ -1,5 +1,12 @@
# Changes
## [0.2.1] - 2019-05-2
### Fixed
* Handle socket read disconnect
## [0.2.0] - 2019-05-12
### Changed

View file

@ -1,6 +1,6 @@
[package]
name = "actix-http"
version = "0.2.0"
version = "0.2.1"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Actix http primitives"
readme = "README.md"
@ -47,7 +47,7 @@ secure-cookies = ["ring"]
actix-service = "0.4.0"
actix-codec = "0.1.2"
actix-connect = "0.2.0"
actix-utils = "0.4.0"
actix-utils = "0.4.1"
actix-server-config = "0.1.1"
actix-threadpool = "0.1.0"

View file

@ -583,6 +583,9 @@ where
self.ka_timer = Some(Delay::new(interval));
} else {
self.flags.insert(Flags::READ_DISCONNECT);
if let Some(mut payload) = self.payload.take() {
payload.set_error(PayloadError::Incomplete(None));
}
return Ok(());
}
} else {
@ -694,7 +697,10 @@ where
if let Some(true) =
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();
}
}
}