better ChannelHandler removal API (#767)

Motivation:

If ChannelHandler removal worked correctly, it was often either by
accident or by intricate knowledge about the implementation of the
ChannelHandler that is to be removed. Especially when it comes to
re-entrancy it mostly didn't work correctly.

Modifications:

- introduce a `RemovableChannelHandler` API
- raise allocation limit per HTTP connection by 1
  (https://bugs.swift.org/browse/SR-9905)

Result:

Make things work by contruction rather than accident
This commit is contained in:
Johannes Weiss authored and GitHub committed 2019-02-12 11:27:48 +01:00
1 parent 2738b6d54f
commit d938264fcb
22 files changed
+334 -62

No files matched your search

+1 -1
View File
@@ -161,7 +161,7 @@ public final class HTTPRequestEncoder: ChannelOutboundHandler {
///
/// This channel handler is used to translate messages from a series of
/// `HTTPServerResponsePart` into the HTTP/1.1 wire format.
public final class HTTPResponseEncoder: ChannelOutboundHandler {
public final class HTTPResponseEncoder: ChannelOutboundHandler, RemovableChannelHandler {
public typealias OutboundIn = HTTPServerResponsePart
public typealias OutboundOut = IOData