mirror of
https://github.com/actix/actix-extras.git
synced 2025-02-02 18:59:04 +01:00
Detect socket disconnection during protocol selection
This commit is contained in:
parent
4227cddd30
commit
51d5006ccf
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
* Preallocate read buffer for h1 codec
|
* Preallocate read buffer for h1 codec
|
||||||
|
|
||||||
|
* Detect socket disconnection during protocol selection
|
||||||
|
|
||||||
|
|
||||||
## [0.1.0-alpha.2] - 2019-03-29
|
## [0.1.0-alpha.2] - 2019-03-29
|
||||||
|
|
||||||
|
@ -247,7 +247,10 @@ where
|
|||||||
loop {
|
loop {
|
||||||
unsafe {
|
unsafe {
|
||||||
let b = item.1.bytes_mut();
|
let b = item.1.bytes_mut();
|
||||||
let n = { try_ready!(item.0.poll_read(b)) };
|
let n = try_ready!(item.0.poll_read(b));
|
||||||
|
if n == 0 {
|
||||||
|
return Ok(Async::Ready(()));
|
||||||
|
}
|
||||||
item.1.advance_mut(n);
|
item.1.advance_mut(n);
|
||||||
if item.1.len() >= HTTP2_PREFACE.len() {
|
if item.1.len() >= HTTP2_PREFACE.len() {
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user