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

fix: re-enable verbose connection read logs #2454

Merged
merged 1 commit into from
Oct 24, 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: 13 additions & 6 deletions src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,14 +1140,21 @@ mod verbose {
fn poll_read(
mut self: Pin<&mut Self>,
cx: &mut Context,
buf: ReadBufCursor<'_>,
mut buf: ReadBufCursor<'_>,
) -> Poll<std::io::Result<()>> {
match Pin::new(&mut self.inner).poll_read(cx, buf) {
// TODO: This _does_ forget the `init` len, so it could result in
// re-initializing twice. Needs upstream support, perhaps.
// SAFETY: Passing to a ReadBuf will never de-initialize any bytes.
let mut vbuf = hyper::rt::ReadBuf::uninit(unsafe { buf.as_mut() });
match Pin::new(&mut self.inner).poll_read(cx, vbuf.unfilled()) {
Poll::Ready(Ok(())) => {
/*
log::trace!("{:08x} read: {:?}", self.id, Escape(buf.filled()));
*/
log::trace!("TODO: verbose poll_read");
log::trace!("{:08x} read: {:?}", self.id, Escape(vbuf.filled()));
let len = vbuf.filled().len();
// SAFETY: The two cursors were for the same buffer. What was
// filled in one is safe in the other.
unsafe {
buf.advance(len);
}
Poll::Ready(Ok(()))
}
Poll::Ready(Err(e)) => Poll::Ready(Err(e)),
Expand Down