Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROTON-2275: Fixed idle_timeout connection option not working for SSL connections on Windows. #255

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions c/src/ssl/schannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Comment on lines +1768 to +1773
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm somewhat confused about this change - the equivalent openssl code does not do anything like this but as far as I know works correctly in the face of idle timeout. This makes me think that this is not the correct fix to the problem.
Especially as the check should be redundent in that the amqp layer processing which does have this check will still be running and should pick up on the issue. Clearly there is an issue somewhere that is specific to the schannel implementation, but this seems like a 'voodoo' fix.
@cliffjansen @kgiusti do either of you have any thoughts?

ssize_t written = 0;
ssize_t total_app_bytes = 0;
bool work_pending;
Expand Down