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

Remove BufStreamHandle #1433

Merged
merged 6 commits into from Apr 10, 2021
Merged

Remove BufStreamHandle #1433

merged 6 commits into from Apr 10, 2021

Conversation

bluejekyll
Copy link
Member

@djc, I'm just doing a little cleanup. I think there are a few todos in here, will move from draft once I change those.

@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #1433 (0757887) into main (0c07d00) will increase coverage by 0.75%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1433      +/-   ##
==========================================
+ Coverage   83.70%   84.44%   +0.75%     
==========================================
  Files         167      166       -1     
  Lines       15867    15689     -178     
==========================================
- Hits        13280    13248      -32     
+ Misses       2587     2441     -146     

@bluejekyll bluejekyll marked this pull request as ready for review April 1, 2021 22:19
@bluejekyll bluejekyll changed the title Remove buf stream handle Remove BufStreamHandle Apr 4, 2021
Copy link
Collaborator

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are really good changes, and thanks for keeping them split into clean commits!

Some style nits follow. One more structural question: I've never really understood why BufDnsStreamHandle needs to carry around the remote_addr when its send() method takes a SerialMessage which already includes a socket address. I feel like we should maybe kill SerialMessage in favor of explicitly returning both the address and the underlying Message where useful. In the current state, it's possible for the address carried around in the SerialMessage to be out of sync with the actual handle/connection used to send it, which is just weird. (This could definitely be addressed in a later PR, just wanted to mention it while I was reviewing your work in this general area.)

crates/resolver/Cargo.toml Outdated Show resolved Hide resolved
crates/resolver/src/caching_client.rs Outdated Show resolved Hide resolved
@bluejekyll
Copy link
Member Author

Yeah, I was looking at removing the name_server. I think the reasoning behind that was mainly for UdpSocket originally. When reviewing this code I was actually not sure if we should remove name_server from SerialMessage or from the BufDnsStreamHandle it's needed downstream in StreamHandle but it's effectively ignored on these interfaces on initial creation of the message and placement into the StreamHandle.

I will make the other changes you've pointed out and look a little more at the name_server option.

@bluejekyll
Copy link
Member Author

Ok, so I don't see a simple way to remove the name_server field without some significant changes, that are more than I want here.

@djc
Copy link
Collaborator

djc commented Apr 7, 2021

LGTM.

@bluejekyll bluejekyll merged commit 7c2567d into main Apr 10, 2021
@bluejekyll bluejekyll deleted the remove_buf_stream_handle branch April 10, 2021 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants