aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_http_ws.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-04-29 11:39:40 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-04-29 11:39:40 +0300
commitb82b93f8f0c229e94a89469b0754bab0e28cd17c (patch)
tree56f5c7a25aa19254b4f30b1cf33fc34dcbadcbb7 /src/ejabberd_http_ws.erl
parentDon't re-define validation functions in multiple places (diff)
Don't validate an option in ejabberd_config:get_option() functions
The commit introduces the following changes: * Now there is no need to pass validating function in ejabberd_config:get_option() functions, because the configuration keeps already validated values. * New function ejabberd_config:get_option/1 is introduced * Function ejabberd_config:get_option/3 is deprecated. If the function is still called, the second argument (validating function) is simply ignored. * The second argument for ejabberd_config:get_option/2 is now a default value, not a validating function.
Diffstat (limited to 'src/ejabberd_http_ws.erl')
-rw-r--r--src/ejabberd_http_ws.erl2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/ejabberd_http_ws.erl b/src/ejabberd_http_ws.erl
index 5231d7ab1..18ba071dd 100644
--- a/src/ejabberd_http_ws.erl
+++ b/src/ejabberd_http_ws.erl
@@ -123,11 +123,9 @@ init([{#ws{ip = IP, http_opts = HOpts}, _} = WS]) ->
Opts = ejabberd_c2s_config:get_c2s_limits() ++ SOpts,
PingInterval = ejabberd_config:get_option(
{websocket_ping_interval, ?MYNAME},
- fun(I) when is_integer(I), I>=0 -> I end,
?PING_INTERVAL) * 1000,
WSTimeout = ejabberd_config:get_option(
{websocket_timeout, ?MYNAME},
- fun(I) when is_integer(I), I>0 -> I end,
?WEBSOCKET_TIMEOUT) * 1000,
Socket = {http_ws, self(), IP},
?DEBUG("Client connected through websocket ~p",