Example apps: Don't use runtime IO config API if CBs are hardcoded

Multiple example applications still use mbedtls_ssl_set_bio() even
if the I/O callbacks are hardcoded. This commit fixes this.
This commit is contained in:
Hanno Becker 2019-07-19 17:07:30 +01:00 committed by Manuel Pégourié-Gonnard
parent 2a0cd5a031
commit 41e5a6871d
9 changed files with 73 additions and 11 deletions

View file

@ -3714,12 +3714,19 @@ data_exchange:
/*
* This illustrates the minimum amount of things you need to set
* up, however you could set up much more if desired, for example
* if you want to share your set up code between the case of
* establishing a new connection and this case.
* up: I/O and timer callbacks/contexts; however you could set up
* much more if desired, for example if you want to share your set
* up code between the case of establishing a new connection and
* this case.
*/
#if !defined(MBEDTLS_SSL_CONF_RECV) && \
!defined(MBEDTLS_SSL_CONF_SEND) && \
!defined(MBEDTLS_SSL_CONF_RECV_TIMEOUT)
mbedtls_ssl_set_bio( &ssl, &io_ctx, send_cb, recv_cb,
opt.nbio == 0 ? recv_timeout_cb : NULL );
#else
mbedtls_ssl_set_bio_ctx( &ssl, &client_fd );
#endif
#if defined(MBEDTLS_TIMING_C)
#if !defined(MBEDTLS_SSL_CONF_SET_TIMER) && \