QUIC TSERVER: Fix probable nondeterminism in some OS network stacks

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19897)
This commit is contained in:
Hugo Landau 2023-01-05 10:51:14 +00:00
parent 522fb49dbc
commit c8e7f842b0

View File

@ -214,11 +214,18 @@ static int test_tserver(void)
if (!TEST_false(ret))
goto err;
if (!TEST_int_eq(SSL_get_error(c_ssl, ret), SSL_ERROR_ZERO_RETURN))
goto err;
/*
* Allow the implementation to take as long as it wants to finally
* notice EOS. Account for varied timings in OS networking stacks.
*/
if (SSL_get_error(c_ssl, ret) != SSL_ERROR_WANT_READ) {
if (!TEST_int_eq(SSL_get_error(c_ssl, ret),
SSL_ERROR_ZERO_RETURN))
goto err;
/* DONE */
break;
/* DONE */
break;
}
}
/*