25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Add send_timeout option to listener

This commit is contained in:
Paweł Chmielowski 2021-06-24 15:16:02 +02:00
parent 795addca7d
commit 6e900d6a8f

View File

@ -113,10 +113,11 @@ init({Port, _, udp} = EndPoint, Module, Opts, SockOpts) ->
_ -> _ ->
{Port, SockOpts} {Port, SockOpts}
end, end,
ExtraOpts2 = lists:keydelete(socket_timeout, 1, ExtraOpts),
case gen_udp:open(Port2, [binary, case gen_udp:open(Port2, [binary,
{active, false}, {active, false},
{reuseaddr, true} | {reuseaddr, true} |
ExtraOpts]) of ExtraOpts2]) of
{ok, Socket} -> {ok, Socket} ->
case inet:sockname(Socket) of case inet:sockname(Socket) of
{ok, {Addr, Port1}} -> {ok, {Addr, Port1}} ->
@ -195,7 +196,6 @@ listen_tcp(Port, SockOpts) ->
{active, false}, {active, false},
{reuseaddr, true}, {reuseaddr, true},
{nodelay, true}, {nodelay, true},
{send_timeout, ?TCP_SEND_TIMEOUT},
{send_timeout_close, true}, {send_timeout_close, true},
{keepalive, true} | ExtraOpts]), {keepalive, true} | ExtraOpts]),
case Res of case Res of
@ -682,6 +682,8 @@ listen_opt_type(max_stanza_size) ->
econf:pos_int(infinity); econf:pos_int(infinity);
listen_opt_type(max_fsm_queue) -> listen_opt_type(max_fsm_queue) ->
econf:pos_int(); econf:pos_int();
listen_opt_type(send_timeout) ->
econf:timeout(seconds, true);
listen_opt_type(shaper) -> listen_opt_type(shaper) ->
econf:shaper(); econf:shaper();
listen_opt_type(access) -> listen_opt_type(access) ->
@ -694,6 +696,7 @@ listen_options() ->
{transport, tcp}, {transport, tcp},
{ip, {0,0,0,0}}, {ip, {0,0,0,0}},
{accept_interval, 0}, {accept_interval, 0},
{send_timeout, 15000},
{backlog, 5}, {backlog, 5},
{use_proxy_protocol, false}, {use_proxy_protocol, false},
{supervisor, true}]. {supervisor, true}].