\begin{description}
\titem{\texttt{ejabberd\_c2s}}
Handles c2s connections.\\
- Options: \texttt{access}, \texttt{certfile}, \texttt{ciphers},
+ Options: \texttt{access}, \texttt{certfile}, \texttt{ciphers}, \texttt{protocol\_options}
- \texttt{max\_fsm\_queue},
- \texttt{max\_stanza\_size}, \texttt{shaper},
- \texttt{starttls}, \texttt{starttls\_required}, \texttt{tls},
+ \texttt{max\_ack\_queue}, \texttt{max\_fsm\_queue},
+ \texttt{max\_stanza\_size}, \texttt{resend\_on\_timeout},
+ \texttt{resume\_timeout}, \texttt{shaper},
+ \texttt{starttls}, \texttt{starttls\_required},
+ \texttt{stream\_management}, \texttt{tls},
\texttt{zlib}, \texttt{tls\_compression}
\titem{\texttt{ejabberd\_s2s\_in}}
Handles incoming s2s connections.\\
auth_module = unknown,
ip,
aux_fields = [],
- lang}).
+ mgmt_state,
+ mgmt_xmlns,
+ mgmt_queue,
+ mgmt_max_queue,
+ mgmt_pending_since,
+ mgmt_timeout,
+ mgmt_resend,
+ mgmt_stanzas_in = 0,
+ mgmt_stanzas_out = 0,
+ lang = <<"">>}).
%-define(DBGFSM, true).
(_) -> false
end,
Opts),
- TLSOpts2 = case proplists:get_bool(tls_compression, Opts) of
- false -> [compression_none | TLSOpts1];
- true -> TLSOpts1
+ TLSOpts2 = case lists:keysearch(protocol_options, 1, Opts) of
+ {value, {_, O}} ->
+ [_|ProtocolOptions] = lists:foldl(
+ fun(X, Acc) -> X ++ Acc end, [],
+ [["|" | binary_to_list(Opt)] || Opt <- O, is_binary(Opt)]
+ ),
+ [{protocol_options, iolist_to_binary(ProtocolOptions)} | TLSOpts1];
+ _ -> TLSOpts1
end,
- TLSOpts = [verify_none | TLSOpts2],
+ TLSOpts3 = case proplists:get_bool(tls_compression, Opts) of
+ false -> [compression_none | TLSOpts2];
+ true -> TLSOpts2
+ end,
+ TLSOpts = [verify_none | TLSOpts3],
+ StreamMgmtEnabled = proplists:get_value(stream_management, Opts, true),
+ StreamMgmtState = if StreamMgmtEnabled -> inactive;
+ true -> disabled
+ end,
+ MaxAckQueue = case proplists:get_value(max_ack_queue, Opts) of
+ Limit when is_integer(Limit), Limit > 0 -> Limit;
+ _ -> 500
+ end,
+ ResumeTimeout = case proplists:get_value(resume_timeout, Opts) of
+ Timeout when is_integer(Timeout), Timeout >= 0 -> Timeout;
+ _ -> 300
+ end,
+ ResendOnTimeout = proplists:get_bool(resend_on_timeout, Opts),
IP = peerip(SockMod, Socket),
%% Check if IP is blacklisted:
case is_ip_blacklisted(IP) of
?INFO_MSG("(~w) Accepted legacy authentication for ~s by ~p",
[StateData#state.socket,
jlib:jid_to_string(JID), AuthModule]),
- Conn = (StateData#state.sockmod):get_conn_type(
- StateData#state.socket),
- SID = {now(), self()},
+ Conn = get_conn_type(StateData),
Info = [{ip, StateData#state.ip}, {conn, Conn},
{auth_module, AuthModule}],
Res = jlib:make_result_iq_reply(