From 9eb8bb6c402d2262ffd4343fc1c501aca5c23276 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 12 Nov 2024 16:20:40 +0100 Subject: [PATCH] mod_matrix_gw_s2s probably works correctly only in Erlang/OTP >= 25 In Erlang/OTP 25, the function inet_res:getbyname/3 returns {ok, Hostent} where the last tuple element of Hostent may be h_addr_list = [inet:ip_address()]} or H_addr_list :: [dns_data()]} However, in Erlang/OTP 24.1 and older, that element was only of type h_addr_list = [inet:ip_address()]} https://erlang.org/documentation/doc-13.0-rc3/lib/kernel-8.4/doc/html/inet_res.html#getbyname-3 https://erlang.org/documentation/doc-12.1/lib/kernel-8.1/doc/html/inet_res.html#getbyname-3 --- src/mod_matrix_gw.erl | 5 +++-- src/mod_matrix_gw_room.erl | 2 +- src/mod_matrix_gw_s2s.erl | 2 +- src/mod_matrix_gw_sup.erl | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mod_matrix_gw.erl b/src/mod_matrix_gw.erl index f65131de2..d880d745e 100644 --- a/src/mod_matrix_gw.erl +++ b/src/mod_matrix_gw.erl @@ -24,7 +24,7 @@ %%%---------------------------------------------------------------------- -module(mod_matrix_gw). --ifndef(OTP_BELOW_24). +-ifndef(OTP_BELOW_25). -author('alexey@process-one.net'). @@ -883,7 +883,8 @@ mod_options(Host) -> mod_doc() -> #{desc => - [?T("https://matrix.org/[Matrix] gateway.")], + [?T("https://matrix.org/[Matrix] gateway. " + "Erlang/OTP 25 or higher is required to use this module.")], note => "added in 24.02", example => ["listen:", diff --git a/src/mod_matrix_gw_room.erl b/src/mod_matrix_gw_room.erl index aa054eb85..6ceff2141 100644 --- a/src/mod_matrix_gw_room.erl +++ b/src/mod_matrix_gw_room.erl @@ -24,7 +24,7 @@ %%%------------------------------------------------------------------- -module(mod_matrix_gw_room). --ifndef(OTP_BELOW_24). +-ifndef(OTP_BELOW_25). -behaviour(gen_statem). %% API diff --git a/src/mod_matrix_gw_s2s.erl b/src/mod_matrix_gw_s2s.erl index 6caceb032..533f250c5 100644 --- a/src/mod_matrix_gw_s2s.erl +++ b/src/mod_matrix_gw_s2s.erl @@ -23,7 +23,7 @@ %%% %%%------------------------------------------------------------------- -module(mod_matrix_gw_s2s). --ifndef(OTP_BELOW_24). +-ifndef(OTP_BELOW_25). -behaviour(gen_statem). %% API diff --git a/src/mod_matrix_gw_sup.erl b/src/mod_matrix_gw_sup.erl index b0c757a5c..f7730a266 100644 --- a/src/mod_matrix_gw_sup.erl +++ b/src/mod_matrix_gw_sup.erl @@ -20,7 +20,7 @@ %%% %%%---------------------------------------------------------------------- -module(mod_matrix_gw_sup). --ifndef(OTP_BELOW_24). +-ifndef(OTP_BELOW_25). -behaviour(supervisor). %% API