struct ssl_backend_data {
SSL_CTX* ctx;
SSL* handle;
- CURLcode io_result;
};
#ifdef OPENSSL_EXTRA
DEBUGASSERT(data);
nwritten = Curl_conn_cf_send(cf->next, data, buf, blen, &result);
wolfSSL_BIO_clear_retry_flags(bio);
- /* wolfSSL is limited in error handling and SSL_read() will
- * return WANT_READ, even though retry was not indicated by
- * the installed BIO. */
- connssl->backend->io_result = result;
- if(nwritten < 0) {
- if(CURLE_AGAIN == result) {
- BIO_set_retry_read(bio);
- nwritten = 0;
- }
- else {
- nwritten = -1;
- }
- }
+ if(nwritten < 0 && CURLE_AGAIN == result)
+ BIO_set_retry_read(bio);
return (int)nwritten;
}
nread = Curl_conn_cf_recv(cf->next, data, buf, blen, &result);
wolfSSL_BIO_clear_retry_flags(bio);
- /* wolfSSL is limited in error handling and SSL_read() will
- * return WANT_READ, even though retry was not indicated by
- * the installed BIO. */
- connssl->backend->io_result = result;
- if(nread < 0) {
- if(CURLE_AGAIN == result) {
- BIO_set_retry_read(bio);
- nread = 0;
- }
- else {
- nread = -1;
- }
- }
+ if(nread < 0 && CURLE_AGAIN == result)
+ BIO_set_retry_read(bio);
return (int)nread;
}
char error_buffer[WOLFSSL_MAX_ERROR_SZ];
int detail = SSL_get_error(backend->handle, ret);
- if(backend->io_result != CURLE_OK && backend->io_result != CURLE_AGAIN) {
- return backend->io_result;
- }
- else if(SSL_ERROR_WANT_READ == detail) {
+ if(SSL_ERROR_WANT_READ == detail) {
connssl->connecting_state = ssl_connect_2_reading;
return CURLE_OK;
}
if(rc <= 0) {
int err = SSL_get_error(backend->handle, rc);
- if(backend->io_result != CURLE_OK && backend->io_result != CURLE_AGAIN) {
- *curlcode = backend->io_result;
- return -1;
- }
switch(err) {
case SSL_ERROR_WANT_READ:
case SSL_ERROR_WANT_WRITE:
if(nread <= 0) {
int err = SSL_get_error(backend->handle, nread);
- if(backend->io_result != CURLE_OK && backend->io_result != CURLE_AGAIN) {
- *curlcode = backend->io_result;
- return -1;
- }
switch(err) {
case SSL_ERROR_ZERO_RETURN: /* no more data */
break;