Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upDocument that UdpSocket::recv and recv_from do not read from the buff… #740
Conversation
KodrAus
reviewed
Oct 4, 2017
| /// excess bytes may be discarded. | ||
| /// | ||
| /// The function is overwriting previous content of `buf`. Slicing | ||
| /// `&buf[..NumRead]` allows efficient access and boundary checking at compile time. |
This comment has been minimized.
This comment has been minimized.
KodrAus
Oct 4, 2017
Assuming NumRead is the result of recv_from I think a more idiomatic name for it is num_read, so we know it's some local variable.
| @@ -82,6 +82,13 @@ impl UdpSocket { | |||
|
|
|||
| /// Receives data from the socket. On success, returns the number of bytes | |||
| /// read and the address from whence the data came. | |||
| /// | |||
| /// The function must be called with valid byte array `buf` of sufficient size to | |||
This comment has been minimized.
This comment has been minimized.
KodrAus
Oct 4, 2017
I think we still need to mention that this function only writes into the buffer and never reads from it.
| /// the number of bytes read and the address from whence the data came. | ||
| /// the number of bytes read. | ||
| /// | ||
| /// The function must be called with valid byte array `buf` of sufficient size to |
This comment has been minimized.
This comment has been minimized.
KodrAus
Oct 4, 2017
I think we still need to mention that this function only writes into the buffer and never reads from it.
This comment has been minimized.
This comment has been minimized.
|
API-Doc has been extended, adding these aspects. I had to re-arrange the text a bit, does it please? |
This comment has been minimized.
This comment has been minimized.
|
Thanks... this looks good to me. Unfortunately, it looks like Android CI broke... which going to block me from merging until it is fixed |
This comment has been minimized.
This comment has been minimized.
|
A CI fix has been merged to master. Would you mind rebasing when you have a moment? Thanks! |
This comment has been minimized.
This comment has been minimized.
KodrAus
commented
Nov 8, 2017
|
@frehberg How's it going? Would you like a hand rebasing this? |
This comment has been minimized.
This comment has been minimized.
|
Something wonky happened with this PR. The commit was rebased, but didn't make it to the PR. I moved it here: #775 |
frehberg commentedOct 3, 2017
…er (#657)