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

WOLFSSL_CBIO_ERR_WANT_READ and WOLFSSL_CBIO_ERR_WANT_WRITE are the same number #156

Closed
aburks opened this issue Oct 6, 2015 · 2 comments
Assignees

Comments

@aburks
Copy link
Contributor

aburks commented Oct 6, 2015

WOLFSSL_CBIO_ERR_WANT_WRITE and WOLFSSL_CBIO_ERR_WANT_READ are the same number, -2. This makes it difficult to determine what error was returned.

@cconlon cconlon self-assigned this Oct 7, 2015
@cconlon
Copy link
Member

cconlon commented Oct 7, 2015

Hi,

We chose to leave these values the same since either wolfSSL (or an application that has registered its own I/O callbacks) already knows if it's inside the Send or Receive callback. Once the callback returns one of these values, wolfSSL handles converting this into the correct error to return to the user.

At the application level, if wolfSSL_read()/write()/connect()/accept() returns SSL_FATAL_ERROR, the user should call wolfSSL_get_error(), which will return either SSL_ERROR_WANT_READ (2) or SSL_ERROR_WANT_WRITE (3). These are different values, allowing the user to distinguish between the two.

@aburks
Copy link
Contributor Author

aburks commented Oct 7, 2015

Thanks for the explanation: I was seeing the expected behavior but wanted to file an issue just to be sure.

@aburks aburks closed this as completed Oct 7, 2015
kojo1 pushed a commit to kojo1/wolfssl that referenced this issue Mar 4, 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

No branches or pull requests

2 participants