mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Add test for resumption with non-blocking I/O
This commit is contained in:
committed by
Paul Bakker
parent
a59af05dce
commit
85beb30b11
@ -990,7 +990,8 @@ int main( int argc, char *argv[] )
|
||||
ssl_set_dbg( &ssl, my_debug, stdout );
|
||||
|
||||
if( opt.nbio == 2 )
|
||||
ssl_set_bio_timeout( &ssl, &server_fd, my_send, my_recv, NULL, 0 );
|
||||
ssl_set_bio_timeout( &ssl, &server_fd, my_send, my_recv, NULL,
|
||||
opt.read_timeout );
|
||||
else
|
||||
ssl_set_bio_timeout( &ssl, &server_fd, net_send, net_recv,
|
||||
#if defined(POLARSSL_HAVE_TIME)
|
||||
@ -1392,6 +1393,17 @@ reconnect:
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( opt.nbio > 0 )
|
||||
ret = net_set_nonblock( server_fd );
|
||||
else
|
||||
ret = net_set_block( server_fd );
|
||||
if( ret != 0 )
|
||||
{
|
||||
printf( " failed\n ! net_set_(non)block() returned -0x%x\n\n",
|
||||
-ret );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
while( ( ret = ssl_handshake( &ssl ) ) != 0 )
|
||||
{
|
||||
if( ret != POLARSSL_ERR_NET_WANT_READ &&
|
||||
|
Reference in New Issue
Block a user