mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
ejabberd_s2s_in: Check for subdomain configuration
If an incoming s2s connection to a subdomain such as conference.example.com is accepted, check for host-specific configuration settings for that subdomain rather than for example.com. This is for consistency with ejabberd_s2s_out, and with my previous commit.
This commit is contained in:
parent
122dfec03d
commit
a9539fef22
@ -138,13 +138,13 @@ process_closed(#{server := LServer} = State, Reason) ->
|
|||||||
tls_options(#{tls_options := TLSOpts, lserver := LServer}) ->
|
tls_options(#{tls_options := TLSOpts, lserver := LServer}) ->
|
||||||
ejabberd_s2s:tls_options(LServer, TLSOpts).
|
ejabberd_s2s:tls_options(LServer, TLSOpts).
|
||||||
|
|
||||||
tls_required(#{server_host := LServer}) ->
|
tls_required(#{lserver := LServer}) ->
|
||||||
ejabberd_s2s:tls_required(LServer).
|
ejabberd_s2s:tls_required(LServer).
|
||||||
|
|
||||||
tls_enabled(#{server_host := LServer}) ->
|
tls_enabled(#{lserver := LServer}) ->
|
||||||
ejabberd_s2s:tls_enabled(LServer).
|
ejabberd_s2s:tls_enabled(LServer).
|
||||||
|
|
||||||
compress_methods(#{server_host := LServer}) ->
|
compress_methods(#{lserver := LServer}) ->
|
||||||
case ejabberd_s2s:zlib_enabled(LServer) of
|
case ejabberd_s2s:zlib_enabled(LServer) of
|
||||||
true -> [<<"zlib">>];
|
true -> [<<"zlib">>];
|
||||||
false -> []
|
false -> []
|
||||||
@ -181,7 +181,7 @@ handle_auth_success(RServer, Mech, _AuthModule,
|
|||||||
?INFO_MSG("(~s) Accepted inbound s2s ~s authentication ~s -> ~s (~s)",
|
?INFO_MSG("(~s) Accepted inbound s2s ~s authentication ~s -> ~s (~s)",
|
||||||
[xmpp_socket:pp(Socket), Mech, RServer, LServer,
|
[xmpp_socket:pp(Socket), Mech, RServer, LServer,
|
||||||
ejabberd_config:may_hide_data(misc:ip_to_list(IP))]),
|
ejabberd_config:may_hide_data(misc:ip_to_list(IP))]),
|
||||||
State1 = case ejabberd_s2s:allow_host(ServerHost, RServer) of
|
State1 = case ejabberd_s2s:allow_host(LServer, RServer) of
|
||||||
true ->
|
true ->
|
||||||
AuthDomains1 = sets:add_element(RServer, AuthDomains),
|
AuthDomains1 = sets:add_element(RServer, AuthDomains),
|
||||||
State0 = change_shaper(State, RServer),
|
State0 = change_shaper(State, RServer),
|
||||||
@ -327,7 +327,7 @@ check_to(#jid{lserver = LServer}, _State) ->
|
|||||||
ejabberd_router:is_my_route(LServer).
|
ejabberd_router:is_my_route(LServer).
|
||||||
|
|
||||||
-spec set_idle_timeout(state()) -> state().
|
-spec set_idle_timeout(state()) -> state().
|
||||||
set_idle_timeout(#{server_host := LServer,
|
set_idle_timeout(#{lserver := LServer,
|
||||||
established := true} = State) ->
|
established := true} = State) ->
|
||||||
Timeout = ejabberd_s2s:get_idle_timeout(LServer),
|
Timeout = ejabberd_s2s:get_idle_timeout(LServer),
|
||||||
xmpp_stream_in:set_timeout(State, Timeout);
|
xmpp_stream_in:set_timeout(State, Timeout);
|
||||||
|
Loading…
Reference in New Issue
Block a user