Fix some coding style issues.

pull/3911/head
TakayukiMatsuo 2021-06-08 16:25:28 +09:00
parent d1e3be1f43
commit 0186d19aba
1 changed files with 5 additions and 9 deletions

View File

@ -41614,7 +41614,6 @@ static THREAD_RETURN WOLFSSL_THREAD SSL_read_test_server_thread(void* args)
char msg[] = "I hear you fa shizzle!"; char msg[] = "I hear you fa shizzle!";
int len = (int) XSTRLEN(msg); int len = (int) XSTRLEN(msg);
char input[1024]; char input[1024];
int idx;
int ret, err; int ret, err;
if (!args) if (!args)
@ -41680,11 +41679,10 @@ static THREAD_RETURN WOLFSSL_THREAD SSL_read_test_server_thread(void* args)
/* read and write data */ /* read and write data */
XMEMSET( input, 0, sizeof(input)); XMEMSET( input, 0, sizeof(input));
idx = 0;
while (1) { while (1) {
ret = wolfSSL_read(ssl, input + idx, sizeof(input)); ret = wolfSSL_read(ssl, input, sizeof(input));
if (ret > 0) { if (ret > 0) {
idx += ret;
break; break;
} }
else { else {
@ -41696,13 +41694,13 @@ static THREAD_RETURN WOLFSSL_THREAD SSL_read_test_server_thread(void* args)
} }
} }
if (err == WOLFSSL_ERROR_ZERO_RETURN || err == WOLFSSL_ERROR_WANT_READ) { if (err == WOLFSSL_ERROR_ZERO_RETURN) {
do { do {
ret = wolfSSL_write(ssl, msg, len); ret = wolfSSL_write(ssl, msg, len);
if (ret > 0) { if (ret > 0) {
break; break;
} }
} while ( ret < 0); } while (ret < 0);
} }
/* bidirectional shutdown */ /* bidirectional shutdown */
@ -41710,13 +41708,11 @@ static THREAD_RETURN WOLFSSL_THREAD SSL_read_test_server_thread(void* args)
continue; continue;
} }
((func_args*)args)->return_code = TEST_SUCCESS;
/* wait for the peer to disconnect the tcp connection */ /* wait for the peer to disconnect the tcp connection */
do { do {
ret = wolfSSL_read(ssl, input, sizeof(input)); ret = wolfSSL_read(ssl, input, sizeof(input));
err = wolfSSL_get_error(ssl, ret); err = wolfSSL_get_error(ssl, ret);
} while( ret > 0 || err != WOLFSSL_ERROR_ZERO_RETURN); } while (ret > 0 || err != WOLFSSL_ERROR_ZERO_RETURN);
/* detect TCP disconnect */ /* detect TCP disconnect */
AssertIntLE(ret,WOLFSSL_FAILURE); AssertIntLE(ret,WOLFSSL_FAILURE);