mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
- Changed behaviour of net_recv(), ssl_fetch_input() and ssl_read(). net_recv() now returns 0 on EOF instead of POLARSSL_ERR_NET_CONN_RESET. ssl_fetch_input() returns POLARSSL_ERR_SSL_CONN_EOF on an EOF from its f_recv() function. ssl_read() returns 0 if a POLARSSL_ERR_SSL_CONN_EOF is received after the handshake.
- Network functions now return POLARSSL_ERR_NET_WANT_READ or POLARSSL_ERR_NET_WANT_WRITE instead of the ambiguous POLARSSL_ERR_NET_TRY_AGAIN
This commit is contained in:
parent
e471cd14bd
commit
831a755d9e
12 changed files with 59 additions and 35 deletions
|
|
@ -115,7 +115,7 @@ int main( void )
|
|||
|
||||
while( ( ret = ssl_write( &ssl, buf, len ) ) <= 0 )
|
||||
{
|
||||
if( ret != POLARSSL_ERR_NET_TRY_AGAIN )
|
||||
if( ret != POLARSSL_ERR_NET_WANT_READ && ret != POLARSSL_ERR_NET_WANT_WRITE )
|
||||
{
|
||||
printf( " failed\n ! ssl_write returned %d\n\n", ret );
|
||||
goto exit;
|
||||
|
|
@ -137,7 +137,7 @@ int main( void )
|
|||
memset( buf, 0, sizeof( buf ) );
|
||||
ret = ssl_read( &ssl, buf, len );
|
||||
|
||||
if( ret == POLARSSL_ERR_NET_TRY_AGAIN )
|
||||
if( ret == POLARSSL_ERR_NET_WANT_READ || ret == POLARSSL_ERR_NET_WANT_WRITE )
|
||||
continue;
|
||||
|
||||
if( ret == POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue