1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Add ssl_close_notify() to servers that missed it

This commit is contained in:
Manuel Pégourié-Gonnard
2014-03-25 11:24:43 +01:00
parent 00d538f8f9
commit 6b0d268bc9
5 changed files with 50 additions and 6 deletions

View File

@ -270,6 +270,21 @@ static void *handle_ssl_connection( void *data )
printf( " [ #%d ] %d bytes written\n=====\n%s\n=====\n",
thread_id, len, (char *) buf );
printf( " [ #%d ] . Closing the connection...", thread_id );
while( ( ret = ssl_close_notify( &ssl ) ) < 0 )
{
if( ret != POLARSSL_ERR_NET_WANT_READ &&
ret != POLARSSL_ERR_NET_WANT_WRITE )
{
printf( " [ #%d ] failed: ssl_close_notify returned -0x%04x\n",
thread_id, ret );
goto thread_exit;
}
}
printf( " ok\n" );
ret = 0;
thread_exit: