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);