diff options
author | Loïc Hoguin <[email protected]> | 2017-01-16 14:22:43 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-01-16 14:36:33 +0100 |
commit | 0f8452cafaa27aeffb103019564c086eacfd34f9 (patch) | |
tree | 6f060f0c7e1eb54508cd128c9bf281869593e812 /src/cowboy_tls.erl | |
parent | e5a8088e68f29206e162ee0f25f45a55ce05fe04 (diff) | |
download | cowboy-0f8452cafaa27aeffb103019564c086eacfd34f9.tar.gz cowboy-0f8452cafaa27aeffb103019564c086eacfd34f9.tar.bz2 cowboy-0f8452cafaa27aeffb103019564c086eacfd34f9.zip |
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')
-rw-r--r-- | src/cowboy_tls.erl | 5 |
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) -> end. 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) end, - Protocol:init(Parent, Ref, Socket, Transport, Opts, Handler). + Protocol:init(Parent, Ref, Socket, Transport, Opts). |