a connection without peer info should be rejected (#300)#304
Merged
HerrMuellerluedenscheid merged 2 commits intoYakifo:mainfrom Jan 6, 2026
Merged
a connection without peer info should be rejected (#300)#304HerrMuellerluedenscheid merged 2 commits intoYakifo:mainfrom
HerrMuellerluedenscheid merged 2 commits intoYakifo:mainfrom
Conversation
| with patch.object(asyncio.streams.StreamWriter, 'get_extra_info', return_value=None) as mock_extra_info: | ||
| with pytest.raises(ConnectError): | ||
| await client.connect("mqtt://127.0.0.1/") | ||
| await asyncio.sleep(0.01) |
Contributor
There was a problem hiding this comment.
Some tests fail with timeout. I'm wondering if the rather short sleep could be one reason?
Collaborator
Author
There was a problem hiding this comment.
appreciate the suggestion!
didn't get a chance to debug yesterday, should have a fix later today
Collaborator
Author
There was a problem hiding this comment.
@HerrMuellerluedenscheid can you review when you get a chance?
HerrMuellerluedenscheid
approved these changes
Dec 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes included in this PR
If a connection doesn't have information about the remote address or port, then the connection should fail gracefully
Fixed
get_peer_infoso that it checks for return value of get_extra_info before separating the address and port.Checklist