mirror of
https://github.com/apple/swift-nio-ssl
synced 2026-11-26 04:57:52 +00:00
Motivation: If a user called close on a channel without attaching a promise, and subsequently called close again with a promise, before the TLS shutdown completes, this would lead to a crash due to a force-unwrap. It has been my experience that crashes are less than ideal, especially when users have done nothing wrong. Modifications: Replaced the force-unwrap with code that correctly persists the promise. Added a test. Result: Less likely to crash.