mirror of
https://github.com/seriyps/mtproto_proxy.git
synced 2026-05-13 08:46:46 +00:00
Upgrade ranch 1.7.0 → 2.2.0
Ranch 2.x breaking changes addressed:
- Protocol callback changed from start_link/4 (Ref, Socket, Transport, Opts)
to start_link/3 (Ref, Transport, Opts); socket obtained via ranch:handshake/1
- ranch:info/0 now returns #{Name => #{...}} instead of [{Name, [proplists]}];
updated mtp_listeners/0, running_ports/0, and config_change_case test
Also update AGENTS.md with CT failure debugging workflow.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
683732e584
commit
fc9ec1d326
7 changed files with 36 additions and 19 deletions
|
|
@ -6,7 +6,7 @@
|
|||
-export([start/2,
|
||||
stop/1,
|
||||
get_rpc_handler_state/1]).
|
||||
-export([start_link/4,
|
||||
-export([start_link/3,
|
||||
ranch_init/1]).
|
||||
-export([init/1,
|
||||
callback_mode/0,
|
||||
|
|
@ -63,7 +63,7 @@ get_rpc_handler_state(Pid) ->
|
|||
|
||||
%% Callbacks
|
||||
|
||||
start_link(Ref, _, Transport, Opts) ->
|
||||
start_link(Ref, Transport, Opts) ->
|
||||
{ok, proc_lib:spawn_link(?MODULE, ranch_init, [{Ref, Transport, Opts}])}.
|
||||
|
||||
ranch_init({Ref, Transport, Opts}) ->
|
||||
|
|
|
|||
|
|
@ -317,11 +317,11 @@ config_change_case({post, Cfg}) ->
|
|||
stop_single(Cfg);
|
||||
config_change_case(Cfg) when is_list(Cfg) ->
|
||||
%% test "max_connections"
|
||||
MaxConnsBefore = [{Listener, proplists:get_value(max_connections, Opts)}
|
||||
MaxConnsBefore = [{Listener, maps:get(max_connections, Opts)}
|
||||
|| {Listener, Opts} <- mtproto_proxy_app:mtp_listeners()],
|
||||
NewMaxConns = 10,
|
||||
ok = mtproto_proxy_app:config_change([{max_connections, NewMaxConns}], [], []),
|
||||
MaxConnsAfter = [{Listener, proplists:get_value(max_connections, Opts)}
|
||||
MaxConnsAfter = [{Listener, maps:get(max_connections, Opts)}
|
||||
|| {Listener, Opts} <- mtproto_proxy_app:mtp_listeners()],
|
||||
?assertNotEqual(MaxConnsBefore, MaxConnsAfter),
|
||||
?assert(lists:all(fun({_Listener, MaxConns}) ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue