From 09e6e3ed46bf2c16fd130691f167dd0795df81b3 Mon Sep 17 00:00:00 2001 From: Attila Kun Date: Mon, 1 Jun 2020 19:16:02 +0100 Subject: [PATCH] PROTON-2275: Fixed idle_timeout connection option not working for SSL connections. --- c/src/ssl/schannel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/c/src/ssl/schannel.cpp b/c/src/ssl/schannel.cpp index 3056890c3f..e72d0c6deb 100644 --- a/c/src/ssl/schannel.cpp +++ b/c/src/ssl/schannel.cpp @@ -1765,6 +1765,12 @@ static ssize_t process_output_ssl( pn_transport_t *transport, unsigned int layer if (!ssl) return PN_EOS; ssl_log( transport, PN_LEVEL_TRACE, "process_output_ssl( max_len=%d )",max_len ); + // This is to match the behaviour of pn_output_write_amqp defined in transport.c. + // Without this, the idle_timeout connection option does not work in case of an SSL connection. + if (!pn_buffer_size(transport->output_buffer) && transport->close_sent) { + return PN_EOS; + } + ssize_t written = 0; ssize_t total_app_bytes = 0; bool work_pending;