diff --git a/src/esockd_acceptor_sup.erl b/src/esockd_acceptor_sup.erl index 6dccddd..f1755c5 100644 --- a/src/esockd_acceptor_sup.erl +++ b/src/esockd_acceptor_sup.erl @@ -33,7 +33,7 @@ -export([tune_socket/2]). %% Test --export([tune_socket_fun/2]). +-export([tune_socket_fun/1]). -define(ACCEPTOR_POOL, 16). @@ -46,7 +46,7 @@ start_supervised(ListenerRef = {Proto, ListenOn}) -> Type = esockd_server:get_listener_prop(ListenerRef, type), Opts = esockd_server:get_listener_prop(ListenerRef, options), - TuneFun = tune_socket_fun(Type, Opts), + TuneFun = tune_socket_fun(Opts), UpgradeFuns = upgrade_funs(Type, Opts), LimiterOpts = esockd_listener_sup:conn_limiter_opts(Opts, {listener, Proto, ListenOn}), Limiter = esockd_listener_sup:conn_rate_limiter(LimiterOpts), @@ -107,7 +107,7 @@ init({AcceptorMod, AcceptorArgs}) -> %% Internal functions %% ------------------------------------------------------------------- -tune_socket_fun(Type, Opts) -> +tune_socket_fun(Opts) -> Opts1 = case proplists:get_bool(tune_buffer, Opts) of true -> [{tune_buffer, true}]; diff --git a/test/esockd_acceptor_SUITE.erl b/test/esockd_acceptor_SUITE.erl index 39e0cce..f76604c 100644 --- a/test/esockd_acceptor_SUITE.erl +++ b/test/esockd_acceptor_SUITE.erl @@ -68,7 +68,7 @@ start(PortNumber, Limiter, Opts) -> {nodelay, true}, {backlog, maps:get(backlog, Opts, 1024)}], {ok, ListenSocket} = gen_tcp:listen(PortNumber, SockOpts), - TuneFun = maps:get(tune_fun, Opts, esockd_acceptor_sup:tune_socket_fun(tcp, [])), + TuneFun = maps:get(tune_fun, Opts, esockd_acceptor_sup:tune_socket_fun([])), StartConn = {fun ?MODULE:start_connection/3, [Opts]}, {ok, AccPid} = esockd_acceptor:start_link(tcp, PortNumber, StartConn, TuneFun, _UpFuns = [], Limiter, ListenSocket), #{lsock => ListenSocket, acceptor => AccPid}.