-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 Http request to be logged when connection_verbose
is set
#1737
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will always work. The first non-empty buf might not be as long as the amount of bytes written. The underlying call could have written from several of the buffers.
@seanmonstar Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you make a new struct Vectored(_, usize)
, you can implement fmt::Debug
that writes to the formatter in a loop, thus not needing to allocate a new temporary vector.
c99fff9
to
4d40fcb
Compare
@seanmonstar Thanks for the suggestion. Updated. |
src/connect.rs
Outdated
Pin::new(&mut self.inner).poll_write_vectored(cx, bufs) | ||
match Pin::new(&mut self.inner).poll_write_vectored(cx, bufs) { | ||
Poll::Ready(Ok(nwritten)) => { | ||
log::trace!("{:08x} write: {:?}", self.id, Vectored { bufs, nwritten }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking, would it be useful if the log indicated it was a writev? Or "write (vectored)" if people are filtering by "write"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for catching this!
Fixes: #1723