From df2610ef179cfca0900d15fa020d30f28e571fff Mon Sep 17 00:00:00 2001 From: nguquen Date: Fri, 5 Apr 2024 20:32:56 +0700 Subject: [PATCH] [fix] buffer full; poll_ready must be called first --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 2fe51f5..efdf7e3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -248,7 +248,9 @@ where } fn call(&mut self, req: http::Request) -> Self::Future { - AsyncResponseFuture::new(req, &mut self.f, self.inner.clone()) + let clone = self.inner.clone(); + let inner = std::mem::replace(&mut self.inner, clone); + AsyncResponseFuture::new(req, &mut self.f, inner) } }