-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
ancillary data size and doc improvement #88425
Conversation
It appears that LinkTed isn't a team member, and thus highfive wouldn't assign this to them. In the interest of having it assigned to someone... r? @the8472 |
@@ -407,7 +434,13 @@ pub struct SocketAncillary<'a> { | |||
} | |||
|
|||
impl<'a> SocketAncillary<'a> { | |||
/// Create an ancillary data with the given buffer. | |||
/// Create a struct for accessing an ancillary data packet in `buffer`. |
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.
accessing [...] in buffer
While this isn't wrong I think it could be misunderstood that the purpose of this constructor is to pass in a buffer that already contains messages and then deserializing it.
The next sentence clarifies it but I think we can still do better. Maybe something like
Create a struct holding ancillary data.
buffer
is used to store the serialized data without dynamic allocations.
Exposing the buffer is mostly an optimization to play nice with low-level network code that uses preallocated buffers.
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'm trying to avoid saying that the struct holds ancillary data because it doesn't.
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.
Create a struct to process ancillary data.
buffer
is used to store the serialized data without dynamic allocations.
@@ -369,7 +384,19 @@ impl<'a> Iterator for Messages<'a> { | |||
} | |||
} | |||
|
|||
/// A Unix socket Ancillary data struct. | |||
/// A struct for accessing a socket ancillary data packet. |
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.
Same as the comment on new
@@ -418,6 +451,7 @@ impl<'a> SocketAncillary<'a> { | |||
/// let mut ancillary_buffer = [0; 128]; | |||
/// let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]); | |||
/// ``` | |||
// FIXME: add size example |
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.
This is meant for a future PR or is this PR incomplete?
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's incomplete.
Ping from triage: |
I can't finish this PR now. |
Triage: |
Functions calculating the size of a control message. Improvement of the doc for
SocketAncillary
and the main doc. Clarification thatadd_fds
andadd_creds
add one control message.r? @LinkTed