Skip to content

extmod/modussl: fix socket and ussl read/write errors for non-blocking sockets #6615

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

Closed
wants to merge 4 commits into from

Conversation

tve
Copy link
Contributor

@tve tve commented Nov 12, 2020

This PR replaces #5825 and is based on #6613

This PR attempts to make read and write behave identically on non-blocking sockets and on SSL wrappers with a non-blocking socket underneath. The goal is for stuff like EAGAIN and EINPROGRESS or None returns to be correct and the same. In the end, that makes it easier to write software that can use plain or SSL sockets.

The PR includes a test that checks all combinations for connect+op on non-blocking sockets with and without ssl (net_hosted/connect_noblock.py). I've tested on esp32, pyboard and unix so far. I don't have any of the other platforms. The test passes on esp32 and fails on unix, the failure is because AXTLS can't quite do non-blocking SSL handshakes. The test fails on pyboard because trying to send 4 bytes on a non-blocking socket that hasn't connected succeeds when it should raise EAGAIN or EINPROGRESS.

@dpgeorge
Copy link
Member

I rebased this on latest master in #6907 .

@dpgeorge
Copy link
Member

Merged in 2c1299b

@dpgeorge dpgeorge closed this Feb 17, 2021
tannewt added a commit to tannewt/circuitpython that referenced this pull request Jul 25, 2022
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.

2 participants