[GH-ISSUE #1932] Small doc issues #821

Open
opened 2026-03-16 00:25:59 +03:00 by kerem · 2 comments
Owner

Originally created by @andrewbaxter on GitHub (May 15, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1932

  1. UdpClientStream says it returns a tuple, but it really only returns one value.
/// it is expected that the resolver wrapper will be responsible for creating and managing
///  new UdpClients such that each new client would have a random port (reduce chance of cache
///  poisoning)
///
/// # Return
///
/// a tuple of a Future Stream which will handle sending and receiving messages, and a
///  handle which can be used to send messages into the stream.

Also, as an aside, I had trouble finding out you use AsyncClient::connect(stream) for udp instead of AsyncClient::new(...) - the examples seem to be all TCP. Maybe TCP is the way to go though.

  1. ResponseHandle::send_response says it consumes itself, but really takes &mut self
/// Serializes and sends a message to to the wrapped handle
///
/// self is consumed as only one message should ever be sent in response to a Request

The above comment makes sense with the signature for RequestHandler:

     async fn handle_request<R: ResponseHandler>(
        &self,
        request: &Request,
        response_handle: R,
    ) -> ResponseInfo;

but since it takes a mut ref, I'd expect response_handle: R.

This is a super cool library, thanks for all the work that went into this!

Originally created by @andrewbaxter on GitHub (May 15, 2023). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1932 1. `UdpClientStream` says it returns a tuple, but it really only returns one value. ``` /// it is expected that the resolver wrapper will be responsible for creating and managing /// new UdpClients such that each new client would have a random port (reduce chance of cache /// poisoning) /// /// # Return /// /// a tuple of a Future Stream which will handle sending and receiving messages, and a /// handle which can be used to send messages into the stream. ``` Also, as an aside, I had trouble finding out you use `AsyncClient::connect(stream)` for udp instead of `AsyncClient::new(...)` - the examples seem to be all TCP. Maybe TCP is the way to go though. 2. `ResponseHandle::send_response` says it consumes itself, but really takes `&mut self` ``` /// Serializes and sends a message to to the wrapped handle /// /// self is consumed as only one message should ever be sent in response to a Request ``` The above comment makes sense with the signature for `RequestHandler`: ``` async fn handle_request<R: ResponseHandler>( &self, request: &Request, response_handle: R, ) -> ResponseInfo; ``` but since it takes a mut ref, I'd expect `response_handle: R`. This is a super cool library, thanks for all the work that went into this!
Author
Owner

@djc commented on GitHub (May 15, 2023):

Would be happy to review a PR with your suggested changes!

<!-- gh-comment-id:1547814747 --> @djc commented on GitHub (May 15, 2023): Would be happy to review a PR with your suggested changes!
Author
Owner

@andrewbaxter commented on GitHub (May 15, 2023):

Sorry, my hands are full with other things atm! I thought leaving the info here might be useful, since it's easy to lose track of things like this.

<!-- gh-comment-id:1547833712 --> @andrewbaxter commented on GitHub (May 15, 2023): Sorry, my hands are full with other things atm! I thought leaving the info here might be useful, since it's easy to lose track of things like this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#821
No description provided.