Skip to content

Commit

Permalink
qtest: Run both client and server during connect
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from #21713)
  • Loading branch information
t8m committed Aug 22, 2023
1 parent 8fd32a0 commit 608a95f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions test/helpers/quictestlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static void run_server_thread(void)

int qtest_create_quic_connection(QUIC_TSERVER *qtserv, SSL *clientssl)
{
int retc = -1, rets = 0, err, abortctr = 0, ret = 0;
int retc = -1, rets = 0, abortctr = 0, ret = 0;
int clienterr = 0, servererr = 0;
#if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG)
/*
Expand Down Expand Up @@ -284,17 +284,19 @@ int qtest_create_quic_connection(QUIC_TSERVER *qtserv, SSL *clientssl)
}

do {
err = SSL_ERROR_WANT_WRITE;
while (!clienterr && retc <= 0 && err == SSL_ERROR_WANT_WRITE) {
if (!clienterr && retc <= 0) {
int err;

retc = SSL_connect(clientssl);
if (retc <= 0)
if (retc <= 0) {
err = SSL_get_error(clientssl, retc);
}

if (!clienterr && retc <= 0 && err != SSL_ERROR_WANT_READ) {
TEST_info("SSL_connect() failed %d, %d", retc, err);
TEST_openssl_errors();
clienterr = 1;
if (err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE) {
TEST_info("SSL_connect() failed %d, %d", retc, err);
TEST_openssl_errors();
clienterr = 1;
}
}
}

/*
Expand Down

0 comments on commit 608a95f

Please sign in to comment.