From: Simon Ruderich Date: Thu, 10 Mar 2011 23:20:06 +0000 (+0100) Subject: src/connection.c: Finish the TLS connection instead of closing it. X-Git-Tag: 0.1~17 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=b806d4f0c51976d6fe52728f03d9d702dc8ab842;p=tlsproxy%2Ftlsproxy.git src/connection.c: Finish the TLS connection instead of closing it. This ensures the transmission was complete. --- 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);