mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-09-07 18:59:56 +00:00
ssl_server2.c: Flush stdout to improve logs timeliness
Signed-off-by: Ronald Cron <[email protected]>
This commit is contained in:
@@ -3592,6 +3592,7 @@ handshake:
|
||||
* 5. Verify the client certificate
|
||||
*/
|
||||
mbedtls_printf(" . Verifying peer X.509 certificate...");
|
||||
fflush(stdout);
|
||||
|
||||
if ((flags = mbedtls_ssl_get_verify_result(&ssl)) != 0) {
|
||||
char vrfy_buf[512];
|
||||
@@ -3609,6 +3610,7 @@ handshake:
|
||||
char crt_buf[512];
|
||||
|
||||
mbedtls_printf(" . Peer certificate information ...\n");
|
||||
fflush(stdout);
|
||||
mbedtls_x509_crt_info(crt_buf, sizeof(crt_buf), " ",
|
||||
mbedtls_ssl_get_peer_cert(&ssl));
|
||||
mbedtls_printf("%s\n", crt_buf);
|
||||
@@ -4061,6 +4063,7 @@ data_exchange:
|
||||
size_t buf_len;
|
||||
|
||||
mbedtls_printf(" . Serializing live connection...");
|
||||
fflush(stdout);
|
||||
|
||||
ret = mbedtls_ssl_context_save(&ssl, NULL, 0, &buf_len);
|
||||
if (ret != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL) {
|
||||
@@ -4095,6 +4098,7 @@ data_exchange:
|
||||
size_t b64_len;
|
||||
|
||||
mbedtls_printf(" . Save serialized context to a file... ");
|
||||
fflush(stdout);
|
||||
|
||||
mbedtls_base64_encode(NULL, 0, &b64_len, context_buf, buf_len);
|
||||
|
||||
@@ -4143,6 +4147,7 @@ data_exchange:
|
||||
if (opt.serialize == 1) {
|
||||
/* nothing to do here, done by context_save() already */
|
||||
mbedtls_printf(" . Context has been reset... ok\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4155,6 +4160,7 @@ data_exchange:
|
||||
*/
|
||||
if (opt.serialize == 2) {
|
||||
mbedtls_printf(" . Freeing and reinitializing context...");
|
||||
fflush(stdout);
|
||||
|
||||
mbedtls_ssl_free(&ssl);
|
||||
|
||||
@@ -4191,6 +4197,7 @@ data_exchange:
|
||||
}
|
||||
|
||||
mbedtls_printf(" . Deserializing connection...");
|
||||
fflush(stdout);
|
||||
|
||||
if ((ret = mbedtls_ssl_context_load(&ssl, context_buf,
|
||||
buf_len)) != 0) {
|
||||
@@ -4220,6 +4227,7 @@ data_exchange:
|
||||
*/
|
||||
close_notify:
|
||||
mbedtls_printf(" . Closing the connection...");
|
||||
fflush(stdout);
|
||||
|
||||
/* No error checking, the connection might be closed already */
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user