-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
extmod/modussl: Fix ussl read/recv/send/write errors when non-blocking (v2) #6907
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
extmod/modussl: Fix ussl read/recv/send/write errors when non-blocking (v2) #6907
Conversation
c8521c0
to
a8336d3
Compare
extmod/modussl_axtls.c
Outdated
int r = ssl_handshake_status(o->ssl_sock); | ||
|
||
if (r != SSL_OK) { | ||
ssl_display_error(r); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tve I think this print was left in by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I don't remember. I know that the axtls version prints errors currently and I believe I put that in to make it look the same as now. Also, I believe the errors are not very detailed and this prints more details. Probably best to remove and look at the tests output...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check it and probably just remove this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code does nothing because CONFIG_SSL_DIAGNOSTICS is disabled, so I'll just remove this.
extmod/modussl_axtls.c
Outdated
|
||
if (r != SSL_OK) { | ||
ssl_display_error(r); | ||
if (r == SSL_CLOSE_NOTIFY || r == SSL_ERROR_CONN_LOST) { // EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tve to get the tests/extmod/ussl_basic.py
test to pass on unix, this line should be:
if (r == SSL_CLOSE_NOTIFY) {
But I'm not sure if that's exactly correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to look...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the check for SSL_ERROR_CONN_LOST
. Doing this, as far as I can tell it doesn't make axtls any better or worse at the net_inet/net_hosted tests, and means it still passes the main test suite. We can fix axtls further in subsequent PRs.
a8336d3
to
bd650f7
Compare
Also fix related problems with socket on esp32, improve docs for wrap_socket, and add more tests.
bd650f7
to
2c1299b
Compare
Great! |
…ep-sleep allow preserving pin state during deep sleep
This is #6615 rebased, and with tests cleaned up.