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

local_address and peer_address can panic #1167

Open
howardjohn opened this issue Jun 20, 2024 · 0 comments
Open

local_address and peer_address can panic #1167

howardjohn opened this issue Jun 20, 2024 · 0 comments

Comments

@howardjohn
Copy link
Member

I don't think we can currently trigger this, but if the connection is fully shutdown this will error and panic. We unwrap it everywhere.

We could maybe use abstraction like

pub struct Listener(TcpListener);
to fetch it once.

Note this only happens if the entire connection is gone, so as long as we don't call shutdown() and THEN *_address() it is all fine. This is more defense in depth

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

No branches or pull requests

1 participant