Files
swift-nio-ssl/Sources
Cory Benfield 085af4c63b Prevent crashes when closing twice. (#52)
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.
2018-11-07 11:30:53 +00:00
..