Change requirements for setting timer callback
The code wants timer callbacks to be set (checked in fetch_input()), and can't easily check whether we're using nbio, so it seems easier to require the callbacks to be always set rather than only with nbio as was previously done.
This commit is contained in:
parent
0eb3eac023
commit
13c8e68477
3 changed files with 6 additions and 11 deletions
|
@ -3963,15 +3963,12 @@ int mbedtls_ssl_context_save( mbedtls_ssl_context *ssl,
|
|||
* (unless they were already set before calling
|
||||
* mbedtls_ssl_session_reset() and the values are suitable for
|
||||
* the present connection). Specifically, you want to call
|
||||
* at least mbedtls_ssl_set_bio(). If you're using a read
|
||||
* timeout (that is, you called
|
||||
* mbedtls_ssl_conf_read_timeout() with a non-zero timeout)
|
||||
* and non-blocking I/O, you also need to set timer callbacks
|
||||
* by calling mbedtls_ssl_set_timer_cb(). All other SSL setter
|
||||
* functions are not necessary to call, either because they're
|
||||
* only used in handshakes, or because the setting is already
|
||||
* saved. You might choose to call them anyway, for example in
|
||||
* order to share code between the cases of establishing a new
|
||||
* at least mbedtls_ssl_set_bio() and
|
||||
* mbedtls_ssl_set_timer_cb(). All other SSL setter functions
|
||||
* are not necessary to call, either because they're only used
|
||||
* in handshakes, or because the setting is already saved. You
|
||||
* might choose to call them anyway, for example in order to
|
||||
* share code between the cases of establishing a new
|
||||
* connection and the case of loading an already-established
|
||||
* connection.
|
||||
*
|
||||
|
|
|
@ -2996,7 +2996,6 @@ send_request:
|
|||
opt.nbio == 0 ? mbedtls_net_recv_timeout : NULL );
|
||||
|
||||
#if defined(MBEDTLS_TIMING_C)
|
||||
if( opt.nbio != 0 && opt.read_timeout != 0 )
|
||||
mbedtls_ssl_set_timer_cb( &ssl, &timer,
|
||||
mbedtls_timing_set_delay,
|
||||
mbedtls_timing_get_delay );
|
||||
|
|
|
@ -4028,7 +4028,6 @@ data_exchange:
|
|||
opt.nbio == 0 ? mbedtls_net_recv_timeout : NULL );
|
||||
|
||||
#if defined(MBEDTLS_TIMING_C)
|
||||
if( opt.nbio != 0 && opt.read_timeout != 0 )
|
||||
mbedtls_ssl_set_timer_cb( &ssl, &timer,
|
||||
mbedtls_timing_set_delay,
|
||||
mbedtls_timing_get_delay );
|
||||
|
|
Loading…
Reference in a new issue