Issue #822 - Allow channel._handle_close to bypass session rekey block #833
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR attempts to address Issue #822 opened by @mathrick
The change adds an argument to
transport._send_user_message
that allows the message to be sent during key negotiation.channel._handle_close
is modified to set this argument toTrue
to enable the closure of a channel even after a rekey has been requested by the client. Normally this closure message (cMSG_CHANNEL_CLOSE
) would be blocked intransport._send_user_message
until after the rekey process has completed. In some cases, as demonstrated in Issue #822, this never occurs and the connection errors out.After implementing this change the demo code in Issue #822 was able to run for at least 700 loop iterations. Prior to the change the best I was able to achieve was 4 iterations before hitting the issue.