Fix ssl_server2 exiting on recoverable errors

This commit is contained in:
Manuel Pégourié-Gonnard 2014-08-15 10:59:03 +02:00
parent bc3e54c70d
commit 250b1ca6f3

View file

@ -1545,7 +1545,7 @@ reset:
{ {
printf( " ! memory allocation failed\n" ); printf( " ! memory allocation failed\n" );
ret = 1; ret = 1;
goto exit; goto reset;
} }
memset( larger_buf, 0, ori_len + extra_len ); memset( larger_buf, 0, ori_len + extra_len );
@ -1558,7 +1558,7 @@ reset:
{ {
printf( " ! ssl_read failed on cached data\n" ); printf( " ! ssl_read failed on cached data\n" );
ret = 1; ret = 1;
goto exit; goto reset;
} }
larger_buf[ori_len + extra_len] = '\0'; larger_buf[ori_len + extra_len] = '\0';
@ -1596,7 +1596,7 @@ reset:
if( ret != POLARSSL_ERR_NET_WANT_READ && ret != POLARSSL_ERR_NET_WANT_WRITE ) if( ret != POLARSSL_ERR_NET_WANT_READ && ret != POLARSSL_ERR_NET_WANT_WRITE )
{ {
printf( " failed\n ! ssl_write returned %d\n\n", ret ); printf( " failed\n ! ssl_write returned %d\n\n", ret );
goto exit; goto reset;
} }
} }
} }
@ -1618,7 +1618,7 @@ reset:
ret != POLARSSL_ERR_NET_WANT_WRITE ) ret != POLARSSL_ERR_NET_WANT_WRITE )
{ {
printf( " failed\n ! ssl_renegotiate returned %d\n\n", ret ); printf( " failed\n ! ssl_renegotiate returned %d\n\n", ret );
goto exit; goto reset;
} }
} }