From e5aef5c1d7be8cffedfedda77d035fa30d5513dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 30 Jan 2012 09:34:29 +0100 Subject: Add cowboy:get_protocol_options/1 and cowboy_set_protocol_options/2 This allows any application to upgrade the protocol options without having to restart the listener. This is most useful to update the dispatch list of HTTP servers, for example. The upgrade is done at the acceptor level, meaning only new connections receive the new protocol options. --- src/cowboy_listener_sup.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cowboy_listener_sup.erl') diff --git a/src/cowboy_listener_sup.erl b/src/cowboy_listener_sup.erl index 1304cbc..da6eca3 100644 --- a/src/cowboy_listener_sup.erl +++ b/src/cowboy_listener_sup.erl @@ -27,7 +27,7 @@ start_link(NbAcceptors, Transport, TransOpts, Protocol, ProtoOpts) -> MaxConns = proplists:get_value(max_connections, TransOpts, 1024), {ok, SupPid} = supervisor:start_link(?MODULE, []), {ok, ListenerPid} = supervisor:start_child(SupPid, - {cowboy_listener, {cowboy_listener, start_link, [MaxConns]}, + {cowboy_listener, {cowboy_listener, start_link, [MaxConns, ProtoOpts]}, permanent, 5000, worker, [cowboy_listener]}), {ok, ReqsPid} = supervisor:start_child(SupPid, {cowboy_requests_sup, {cowboy_requests_sup, start_link, []}, -- cgit v1.2.3