path: root/src/cowboy_tls.erl
diff options
authorLoïc Hoguin <[email protected]>2017-01-16 14:22:43 +0100
committerLoïc Hoguin <[email protected]>2017-01-16 14:36:33 +0100
commit0f8452cafaa27aeffb103019564c086eacfd34f9 (patch)
tree6f060f0c7e1eb54508cd128c9bf281869593e812 /src/cowboy_tls.erl
parente5a8088e68f29206e162ee0f25f45a55ce05fe04 (diff)
Add support for multiple stream handlers
The stream handlers can be specified using the protocol option 'stream_handlers'. It defaults to [cowboy_stream_h]. The cowboy_stream_h module currently does not forward the calls to further stream handlers. It feels like an edge case; usually we'd want to put our own handlers between the protocol code and the request process. I am therefore going to focus on other things for now. The various types and specifications for stream handlers have been updated and the cowboy_stream module can now be safely used as a behavior. The interface might change a little more, though. This commit does not include tests or documentation. They will follow separately.
Diffstat (limited to 'src/cowboy_tls.erl')
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cowboy_tls.erl b/src/cowboy_tls.erl
index 7dd558a..24e6666 100644
--- a/src/cowboy_tls.erl
+++ b/src/cowboy_tls.erl
@@ -45,9 +45,8 @@ init(Parent, Ref, Socket, Transport, Opts) ->
init(Parent, Ref, Socket, Transport, Opts, Protocol) ->
- {Handler, Type} = maps:get(stream_handler, Opts, {cowboy_stream_h, supervisor}),
- _ = case Type of
+ _ = case maps:get(connection_type, Opts, supervisor) of
worker -> ok;
supervisor -> process_flag(trap_exit, true)
- Protocol:init(Parent, Ref, Socket, Transport, Opts, Handler).
+ Protocol:init(Parent, Ref, Socket, Transport, Opts).