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

When creating true socket connection, use host and port stored in instance variables, not in the Mocket class's variable #222

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

ento
Copy link
Collaborator

@ento ento commented Feb 5, 2024

Fixes #221

The issue was caused by how Mocket._address was used to determine which host and port to connect to in MocketSocket.true_sendall. Mocket._address gets overwritten when another MocketSocket instance's connect method gets called and could be the wrong address to use in that case.

This PR fixes the issue by referencing the current instance's _host and _port attributes instead.

I see that, in MocketSocket.getpeercert, there's code that accounts for the case where _host and _port are not set to truthy values; not sure if that can happen in true_sendall as well and should be accounted for, or if the current simple fix will be enough (or maybe even that it'd be a different kind of bug if _host and _port aren't set by the time true_sendall gets called).

Copy link

sonarcloud bot commented Feb 5, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@mindflayer mindflayer merged commit f497448 into mindflayer:main Feb 5, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants