1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-18 15:41:17 +00:00

remove unused flag upgrade (#1992)

This commit is contained in:
fakeshadow 2021-02-14 10:13:05 -08:00 committed by GitHub
parent 308b70b039
commit 68d1bd88b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,6 @@ bitflags! {
const SHUTDOWN = 0b0000_0100; const SHUTDOWN = 0b0000_0100;
const READ_DISCONNECT = 0b0000_1000; const READ_DISCONNECT = 0b0000_1000;
const WRITE_DISCONNECT = 0b0001_0000; const WRITE_DISCONNECT = 0b0001_0000;
const UPGRADE = 0b0010_0000;
} }
} }
@ -215,10 +214,7 @@ where
U::Error: fmt::Display, U::Error: fmt::Display,
{ {
fn can_read(&self, cx: &mut Context<'_>) -> bool { fn can_read(&self, cx: &mut Context<'_>) -> bool {
if self if self.flags.contains(Flags::READ_DISCONNECT) {
.flags
.intersects(Flags::READ_DISCONNECT | Flags::UPGRADE)
{
false false
} else if let Some(ref info) = self.payload { } else if let Some(ref info) = self.payload {
info.need_read(cx) == PayloadStatus::Read info.need_read(cx) == PayloadStatus::Read
@ -501,7 +497,7 @@ where
} }
/// Process one incoming request. /// Process one incoming request.
pub(self) fn poll_request( fn poll_request(
mut self: Pin<&mut Self>, mut self: Pin<&mut Self>,
cx: &mut Context<'_>, cx: &mut Context<'_>,
) -> Result<bool, DispatchError> { ) -> Result<bool, DispatchError> {