Skip to content

Handle ssl.SSLWantWriteError#164

Merged
Safihre merged 1 commit intosabnzbd:masterfrom
mnightingale:feature/handle_want_write
Jan 16, 2026
Merged

Handle ssl.SSLWantWriteError#164
Safihre merged 1 commit intosabnzbd:masterfrom
mnightingale:feature/handle_want_write

Conversation

@mnightingale
Copy link
Contributor

Even when reading from a socket it’s possible to get an SSL_ERROR_WANT_WRITE error.

Reference: https://docs.openssl.org/master/man3/SSL_read/

If the underlying BIO is nonblocking, a read function will also return when the underlying BIO could not satisfy the needs of the function to continue the operation. In this case a call to SSL_get_error(3) with the return value of the read function will yield SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. As at any time it's possible that non-application data needs to be sent, a read function can also cause write operations.

Both are non-fatal, but we need to make the Python code aware of them.

I also made the exception messages match what Python would usually raise.

@Safihre Safihre merged commit fc7bdbe into sabnzbd:master Jan 16, 2026
23 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

Development

Successfully merging this pull request may close these issues.

2 participants