Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(net): batch P2PStream sends" #11658

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions crates/net/eth-wire/src/p2pstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,24 +614,19 @@ where
/// Returns `Poll::Ready(Ok(()))` when no buffered items remain.
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
let mut this = self.project();
let poll_res = loop {
match this.inner.as_mut().poll_ready(cx) {
Poll::Pending => break Poll::Pending,
Poll::Ready(Err(err)) => break Poll::Ready(Err(err.into())),
Poll::Ready(Ok(())) => {
loop {
match ready!(this.inner.as_mut().poll_flush(cx)) {
Err(err) => return Poll::Ready(Err(err.into())),
Ok(()) => {
let Some(message) = this.outgoing_messages.pop_front() else {
break Poll::Ready(Ok(()))
return Poll::Ready(Ok(()))
};
if let Err(err) = this.inner.as_mut().start_send(message) {
break Poll::Ready(Err(err.into()))
return Poll::Ready(Err(err.into()))
}
}
}
};

ready!(this.inner.as_mut().poll_flush(cx))?;

poll_res
}
}

fn poll_close(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Expand Down
Loading