1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 17:52:56 +01:00

do not self wake up when have a payload (#1984)

This commit is contained in:
fakeshadow 2021-02-12 12:33:13 -08:00 committed by GitHub
parent ce9b2770e2
commit 95113ad12f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -745,7 +745,12 @@ where
// at this point it's not known io is still scheduled to
// be waked up. so force wake up dispatcher just in case.
// TODO: figure out the overhead.
cx.waker().wake_by_ref();
if this.payload.is_none() {
// When dispatcher has a payload. The responsibility of
// wake up stream would be shift to PayloadSender.
// Therefore no self wake up is needed.
cx.waker().wake_by_ref();
}
return Ok(false);
}