FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/src/bio.c
/* Helper function for writing to a WOLFSSL_BIO_SSL type
 *
 * returns the amount written in bytes on success
 */
Helper function for writing to a WOLFSSL_BIO_SSL type
returns the amount written in bytes on success
Helper function for writing to a WOLFSSL_BIO_SSL type returns the amount written in bytes on success
static int wolfSSL_BIO_SSL_write(WOLFSSL_BIO* bio, const void* data,
        int len, WOLFSSL_BIO* front)
{
    int ret;
    WOLFSSL_ENTER("wolfSSL_BIO_SSL_write");
    if (bio->ptr == NULL) {
        return BAD_FUNC_ARG;
    }
    bio->flags &= ~(WOLFSSL_BIO_FLAG_RETRY); 
    ret = wolfSSL_write((WOLFSSL*)bio->ptr, data, len);
    if (ret == 0)
        front->eof = 1;
    else if (ret < 0) {
        int err = wolfSSL_get_error((WOLFSSL*)bio->ptr, 0);
        if ( !(err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) ) {
            front->eof = 1;
        }
        else {
            bio->flags |= WOLFSSL_BIO_FLAG_RETRY; 
        }
    }
    return ret;
}
static int wolfSSL_BIO_SSL_write ( WOLFSSL_BIO * bio , const void * data , int len , WOLFSSL_BIO * front ) { int ret ; WOLFSSL_ENTER ( " " ) ; if ( bio -> ptr == NULL ) { return BAD_FUNC_ARG ; } bio -> flags &= ~ ( WOLFSSL_BIO_FLAG_RETRY ) ; ret = wolfSSL_write ( ( WOLFSSL * ) bio -> ptr , data , len ) ; if ( ret == 0 ) front -> eof = 1 ; else if ( ret < 0 ) { int err = wolfSSL_get_error ( ( WOLFSSL * ) bio -> ptr , 0 ) ; if ( ! ( err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE ) ) { front -> eof = 1 ; } else { bio -> flags |= WOLFSSL_BIO_FLAG_RETRY ; } } return ret ; }
Helper function for writing to a WOLFSSL_BIO_SSL type
 returns the amount written in bytes on success
Helper function for writing to a WOLFSSL_BIO_SSL type returns the amount written in bytes on success
/* default no retry */ /* should retry */