mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-23 16:20:49 +00:00
ssl_server: Allow the client to close the connection first
This is necessary when testing against OpenSSL 1.0.2g. In the server, flush more often. Otherwise, when stdout is redirected to a file, the server gets killed before it writes important information, such as the logs that we expect in the test cases. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
8d64fe1c56
commit
3104685cc6
@ -312,16 +312,19 @@ reset:
|
||||
mbedtls_printf(" %d bytes written\n\n%s\n", len, (char *) buf);
|
||||
|
||||
mbedtls_printf(" . Closing the connection...");
|
||||
fflush(stdout);
|
||||
|
||||
while ((ret = mbedtls_ssl_close_notify(&ssl)) < 0) {
|
||||
if (ret != MBEDTLS_ERR_SSL_WANT_READ &&
|
||||
ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
|
||||
ret != MBEDTLS_ERR_SSL_WANT_WRITE &&
|
||||
ret != MBEDTLS_ERR_NET_CONN_RESET) {
|
||||
mbedtls_printf(" failed\n ! mbedtls_ssl_close_notify returned %d\n\n", ret);
|
||||
goto reset;
|
||||
}
|
||||
}
|
||||
|
||||
mbedtls_printf(" ok\n");
|
||||
fflush(stdout);
|
||||
|
||||
ret = 0;
|
||||
goto reset;
|
||||
|
Loading…
x
Reference in New Issue
Block a user