From b3155e69132ce313778deafd8f5b0120e3eeaee8 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Thu, 11 Feb 2021 21:09:03 -0800 Subject: [PATCH] do not self wake up when have a payload --- actix-http/src/h1/dispatcher.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index 7ee2ee258..5ad4c98db 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -772,7 +772,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); }