1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-22 21:55:10 +02:00

drop connection if handler get dropped without consuming payload

This commit is contained in:
Nikolay Kim
2018-02-27 16:08:57 -08:00
parent 9b06eac720
commit e2c8f17c2c
5 changed files with 35 additions and 30 deletions

View File

@@ -18,7 +18,7 @@ use body::{Body, Binary};
use error::PayloadError;
use httprequest::HttpInnerMessage;
use httpresponse::HttpResponse;
use payload::{PayloadSender, PayloadWriter};
use payload::{PayloadSender, PayloadWriter, PayloadStatus};
use super::shared::SharedBytes;
@@ -120,7 +120,7 @@ impl PayloadWriter for PayloadType {
}
#[inline]
fn need_read(&self) -> bool {
fn need_read(&self) -> PayloadStatus {
match *self {
PayloadType::Sender(ref sender) => sender.need_read(),
PayloadType::Encoding(ref enc) => enc.need_read(),
@@ -352,7 +352,7 @@ impl PayloadWriter for EncodedPayload {
}
#[inline]
fn need_read(&self) -> bool {
fn need_read(&self) -> PayloadStatus {
self.inner.need_read()
}
}