This commit is contained in:
Nikolay Kim 2025-03-15 09:16:49 +01:00
parent f46d69ffea
commit 1eaaeb2be7

View file

@ -149,10 +149,12 @@ where
// spawn current publish future to runtime // spawn current publish future to runtime
// so it could complete error handling // so it could complete error handling
let st = ready!(inner.poll_request(cx)); let st = ready!(inner.poll_request(cx));
if let State::CallPublish { fut } = if inner.payload.is_some() {
mem::replace(&mut *this.st, State::ReadRequest) if let State::CallPublish { fut } =
{ mem::replace(&mut *this.st, State::ReadRequest)
crate::rt::spawn(fut); {
crate::rt::spawn(fut);
}
} }
st st
} }
@ -350,7 +352,7 @@ where
.io .io
.encode(Message::Item((msg, body.size())), &self.codec) .encode(Message::Item((msg, body.size())), &self.codec)
.map_err(|err| { .map_err(|err| {
if let Some(mut payload) = self.payload.take() { if let Some(ref mut payload) = self.payload {
payload.1.set_error(PayloadError::Incomplete(None)); payload.1.set_error(PayloadError::Incomplete(None));
} }
err err
@ -449,7 +451,7 @@ where
} }
fn set_payload_error(&mut self, err: PayloadError) { fn set_payload_error(&mut self, err: PayloadError) {
if let Some(mut payload) = self.payload.take() { if let Some(ref mut payload) = self.payload {
payload.1.set_error(err); payload.1.set_error(err);
} }
} }