From b806d4f0c51976d6fe52728f03d9d702dc8ab842 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 11 Mar 2011 00:20:06 +0100 Subject: [PATCH] src/connection.c: Finish the TLS connection instead of closing it. This ensures the transmission was complete. --- src/connection.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/connection.c b/src/connection.c index 26947ff..520ce40 100644 --- a/src/connection.c +++ b/src/connection.c @@ -237,12 +237,13 @@ void handle_connection(int client_socket) { LOG(LOG_DEBUG, "finished transferring data"); out: - /* Close TLS sessions if necessary. */ + /* Close TLS sessions if necessary. Use GNUTLS_SHUT_RDWR so the data is + * reliable transmitted. */ if (0 != server_session_started) { - gnutls_bye(server_session, GNUTLS_SHUT_WR); + gnutls_bye(server_session, GNUTLS_SHUT_RDWR); } if (0 != client_session_started) { - gnutls_bye(client_session, GNUTLS_SHUT_WR); + gnutls_bye(client_session, GNUTLS_SHUT_RDWR); } if (0 != server_session_init) { gnutls_deinit(server_session); -- 2.45.2