Test on OTP-26, drop pre-OTP-23; OTP-27 not compatible yet; fix dialyzer

This commit is contained in:
Sergey Prokhorov 2024-12-04 12:35:32 +01:00
parent 9072be78bd
commit f9c2d32d4f
No known key found for this signature in database
GPG key ID: 1C570244E4EF3337
7 changed files with 12 additions and 11 deletions

View file

@ -19,15 +19,14 @@ jobs:
matrix:
os:
- "ubuntu-20.04"
rebar3: ["3.18.0"]
rebar3: ["3.20.0"]
otp:
- "25.1"
- "26.2"
- "25.3"
- "24.3"
- "23.3"
- "22.3"
include:
- otp: "21.3"
rebar3: "3.15.2"
- otp: "23.3"
rebar3: "3.18.0"
os: "ubuntu-20.04"
env:
SHELL: /bin/sh # needed for erlexec

View file

@ -16,7 +16,7 @@
try_decode_packet/2,
encode_packet/2,
fold_packets/4, fold_packets_if/4]).
-export_type([codec/0]).
-export_type([codec/0, packet_codec/0]).
-type state() :: any().
-type crypto_codec() :: mtp_aes_cbc

View file

@ -26,7 +26,7 @@
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-export_type([netloc_v4v6/0]).
-export_type([dc_id/0, netloc/0, netloc_v4v6/0]).
-type dc_id() :: integer().
-type netloc() :: {inet:ip4_address(), inet:port_number()}.

View file

@ -20,7 +20,7 @@
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
-spec start_conn(pid(), mtp_conf:dc_id()) -> {ok, pid()}.
-spec start_conn(pid(), mtp_config:dc_id()) -> {ok, pid()}.
start_conn(Pool, DcId) ->
supervisor:start_child(?SERVER, [Pool, DcId]).

View file

@ -70,7 +70,7 @@ keys_str() ->
[{Name, Port, hex(Secret)}
|| {Name, Port, Secret} <- application:get_env(?APP, ports, [])].
-spec send(pid(), mtp_rpc:packet()) -> ok.
-spec send(pid(), {proxy_ans, pid(), binary()} | {simple_ack, pid(), binary()} | {close_ext, pid()}) -> ok.
send(Upstream, Packet) ->
gen_server:cast(Upstream, Packet).

View file

@ -22,6 +22,8 @@
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-export_type([sub_tab/0]).
-type sub_tab() :: atom().
-type value() :: mtp_policy:db_val().

View file

@ -19,7 +19,7 @@
%% Helpers
-export([inet_pton/1,
encode_ip_port/2]).
-export_type([codec/0]).
-export_type([conn_id/0, packet/0, codec/0]).
-dialyzer(no_improper_lists).