Ok for close_notify to fail
This commit is contained in:
parent
127ab88dba
commit
994f8b554f
@ -1336,24 +1336,13 @@ send_request:
|
|||||||
close_notify:
|
close_notify:
|
||||||
printf( " . Closing the connection..." );
|
printf( " . Closing the connection..." );
|
||||||
|
|
||||||
while( ( ret = ssl_close_notify( &ssl ) ) < 0 )
|
/* No error checking, the connection might be closed already */
|
||||||
{
|
do
|
||||||
if( ret == POLARSSL_ERR_NET_CONN_RESET )
|
ret = ssl_close_notify( &ssl );
|
||||||
{
|
while( ret == POLARSSL_ERR_NET_WANT_WRITE );
|
||||||
printf( " ok (already closed by peer)\n" );
|
ret = 0;
|
||||||
ret = 0;
|
|
||||||
goto reconnect;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ret != POLARSSL_ERR_NET_WANT_READ &&
|
printf( " done\n" );
|
||||||
ret != POLARSSL_ERR_NET_WANT_WRITE )
|
|
||||||
{
|
|
||||||
printf( " failed\n ! ssl_close_notify returned %d\n\n", ret );
|
|
||||||
goto reconnect;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printf( " ok\n" );
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 9. Reconnect?
|
* 9. Reconnect?
|
||||||
|
@ -1949,24 +1949,13 @@ data_exchange:
|
|||||||
close_notify:
|
close_notify:
|
||||||
printf( " . Closing the connection..." );
|
printf( " . Closing the connection..." );
|
||||||
|
|
||||||
while( ( ret = ssl_close_notify( &ssl ) ) < 0 )
|
/* No error checking, the connection might be closed already */
|
||||||
{
|
do
|
||||||
if( ret == POLARSSL_ERR_NET_CONN_RESET )
|
ret = ssl_close_notify( &ssl );
|
||||||
{
|
while( ret == POLARSSL_ERR_NET_WANT_WRITE );
|
||||||
printf( " ok (already closed by peer)\n" );
|
ret = 0;
|
||||||
ret = 0;
|
|
||||||
goto reset;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ret != POLARSSL_ERR_NET_WANT_READ &&
|
printf( " done\n" );
|
||||||
ret != POLARSSL_ERR_NET_WANT_WRITE )
|
|
||||||
{
|
|
||||||
printf( " failed\n ! ssl_close_notify returned %d\n\n", ret );
|
|
||||||
goto reset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printf( " ok\n" );
|
|
||||||
goto reset;
|
goto reset;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user