-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-414: Correct error handling in KeyExchangeMessageHandler
During KEX we may queue up higher-level packets. When KEX ends, we flush this queue, writing all these queued packets. When writing a queued packet fails, previous code handled the failure wrongly, leading to an inconsistent state that could cause an endless loop in writeOrEnqueue. Fix this by making sure that (a) kexFlushed is true also in this case, and (b) by fulfilling the kexFlushedFuture and closing the session outside of the critical region. Because kexFlushed = true now also on failure, drain the queue and set up all the queued futures such that they will be fulfilled with the exception. Additionally, do the same if the session closes while we're still flushing queued packets. Bug: #414
- Loading branch information
Showing
2 changed files
with
75 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters