Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C2s/ejabberd #3805

Merged
merged 4 commits into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion big_tests/tests/acc_e2e_SUITE_data/acc_test_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ drop_if_jid_not_mine(X) ->

recreate_table() ->
try ets:delete(test_message_index) catch _:_ -> ok end,
ets:new(test_message_index, [named_table, public, {heir, whereis(ejabberd_c2s_sup), none}]).
ets:new(test_message_index, [named_table, public, {heir, whereis(mongoose_c2s_sup), none}]).

check_acc(#{ stanza := #{ type := <<"chat">> } } = Acc) ->
Ref = mongoose_acc:ref(Acc),
Expand Down
17 changes: 8 additions & 9 deletions big_tests/tests/component_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ all() ->
].

groups() ->
G = [{xep0114_tcp, [], xep0114_tests()},
{xep0114_ws, [], xep0114_tests()},
{subdomain, [], [register_subdomain]},
{hidden_components, [], [disco_with_hidden_component]},
{distributed, [], [register_in_cluster,
register_same_on_both
%clear_on_node_down TODO: Breaks cover
]}],
ct_helper:repeat_all_until_all_ok(G).
[{xep0114_tcp, [], xep0114_tests()},
{xep0114_ws, [], xep0114_tests()},
{subdomain, [], [register_subdomain]},
{hidden_components, [], [disco_with_hidden_component]},
{distributed, [], [register_in_cluster,
register_same_on_both
%clear_on_node_down TODO: Breaks cover
]}].

suite() ->
require_rpc_nodes([mim]) ++ escalus:suite().
Expand Down
2 changes: 1 addition & 1 deletion big_tests/tests/mongoose_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ wait_for_session_count(Expected) ->
wait_until(fun() -> length(get_session_specs()) end, Expected, #{name => session_count}).

get_session_specs() ->
rpc(mim(), supervisor, which_children, [ejabberd_c2s_sup]).
rpc(mim(), supervisor, which_children, [mongoose_c2s_sup]).

get_session_pids() ->
[element(2, X) || X <- get_session_specs()].
Expand Down
2 changes: 1 addition & 1 deletion big_tests/tests/sm_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ wait_for_c2s_unacked_count(C2SPid, Count) ->

get_c2s_unacked_count(C2SPid) ->
StateData = mongoose_helper:get_c2s_state_data(C2SPid),
SmStateData = rpc(mim(), mongoose_c2s, get_mod_state, [StateData, mod_stream_management]),
{ok, SmStateData} = rpc(mim(), mongoose_c2s, get_mod_state, [StateData, mod_stream_management]),
element(3, SmStateData).

wait_for_resource_count(Client, N) ->
Expand Down
7 changes: 2 additions & 5 deletions big_tests/tests/websockets_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ all() ->
{group, wss_chat}].

groups() ->
G = [{ws_chat, [sequence], test_cases()},
{wss_chat, [sequence], test_cases()}
],
ct_helper:repeat_all_until_all_ok(G).
[{ws_chat, [sequence], test_cases()},
{wss_chat, [sequence], test_cases()}].

test_cases() ->
[chat_msg,
Expand Down Expand Up @@ -111,4 +109,3 @@ escape_attrs(Config) ->
special_chars_helper:check_attr_from_to(Geralt, Carol)

end).

2 changes: 1 addition & 1 deletion doc/developers-guide/accumulators.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ While allowed, stanza-less accumulators usage should be avoided.
* `element(t())`
* `to_jid(t())`
* `from_jid(t())`
* `packet(t())` - Returns an `ejabberd_c2s:packet()` if there is a stanza in the accumulator.
* `packet(t())` - Returns an `mongoose_c2s:packet()` if there is a stanza in the accumulator.
* `stanza_name(t())` - Returns `name` value from `stanza` map.
* `stanza_type(t())` - Returns `type` value from `stanza` map.
* `stanza_ref(t())` - Returns `ref` value from `stanza` map. This is not the same as `ref(t())`!
Expand Down
141 changes: 0 additions & 141 deletions include/ejabberd_c2s.hrl

This file was deleted.

1 change: 1 addition & 0 deletions include/jlib.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
-record(xmlstreamerror, {name :: binary()}).

-define(STREAM_TRAILER, <<"</stream:stream>">>).
-define(XML_STREAM_TRAILER, #xmlstreamend{name = <<"stream:stream">>}).

-endif.
3 changes: 1 addition & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@

%%% Other
{pa, {git, "https://github.com/erszcz/pa.git", {branch, "master"}}},
%% MR of jwerl - https://gitlab.com/glejeune/jwerl/-/merge_requests/13
{jwerl, {git, "https://gitlab.com/vkatsuba/jwerl.git", {branch, "refactoring/otp-24"}}},
{jwerl, "1.2.0"},
{cpool, "0.1.0"}, %% Do not upgrade cpool to version 0.1.1, it has bugs
{nkpacket, {git, "https://github.com/michalwski/nkpacket.git", {ref, "f7c5349"}}},
{nksip, {git, "https://github.com/NetComposer/nksip.git", {ref, "1a29ef3"}}}
Expand Down
7 changes: 3 additions & 4 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@
{<<"jid">>,{pkg,<<"mongoose_jid">>,<<"2.0.0">>},0},
{<<"jiffy">>,{pkg,<<"jiffy">>,<<"1.1.1">>},0},
{<<"jsx">>,{pkg,<<"jsx">>,<<"2.9.0">>},1},
{<<"jwerl">>,
{git,"https://gitlab.com/vkatsuba/jwerl.git",
{ref,"d03607fd14a6a7556f01014af84903a3df60ff5d"}},
0},
{<<"jwerl">>,{pkg,<<"jwerl">>,<<"1.2.0">>},0},
{<<"lager">>,{pkg,<<"lager">>,<<"3.9.2">>},0},
{<<"lasse">>,{pkg,<<"lasse">>,<<"1.2.0">>},0},
{<<"lhttpc">>,{pkg,<<"lhttpc">>,<<"1.6.2">>},1},
Expand Down Expand Up @@ -172,6 +169,7 @@
{<<"jid">>, <<"0D0FD1130EAD05DF672D1C9E0405D3000F0C87A7D446577755CF5EB173104FE9">>},
{<<"jiffy">>, <<"ACA10F47AA91697BF24AB9582C74E00E8E95474C7EF9F76D4F1A338D0F5DE21B">>},
{<<"jsx">>, <<"D2F6E5F069C00266CAD52FB15D87C428579EA4D7D73A33669E12679E203329DD">>},
{<<"jwerl">>, <<"2A0EC870BE0B803BBEEE1463DC5AE05E3D64EEAE2ABC7DB4250ABC611FE7E320">>},
{<<"lager">>, <<"4CAB289120EB24964E3886BD22323CB5FEFE4510C076992A23AD18CF85413D8C">>},
{<<"lasse">>, <<"DB8F06983B235F6C4C86AC79BCF23EDDCA16FCCCAD1EB45F222852BB133BD793">>},
{<<"lhttpc">>, <<"044F16F0018C7AA7E945E9E9406C7F6035E0B8BC08BF77B00C78CE260E1071E3">>},
Expand Down Expand Up @@ -234,6 +232,7 @@
{<<"jid">>, <<"7BAE8403552D5BCECD1CD2A848445B5FC3533F5EEB355173A0531A1A1AA8E008">>},
{<<"jiffy">>, <<"62E1F0581C3C19C33A725C781DFA88410D8BFF1BBAFC3885A2552286B4785C4C">>},
{<<"jsx">>, <<"8EE1DB1CABAFDD578A2776A6AAAE87C2A8CE54B47B59E9EC7DAB5D7EB71CD8DC">>},
{<<"jwerl">>, <<"894C275CA4CF3A4F293541927CA3D7A2622B21D8BD70580EF70EACB0425F1941">>},
{<<"lager">>, <<"7F904D9E87A8CB7E66156ED31768D1C8E26EBA1D54F4BC85B1AA4AC1F6340C28">>},
{<<"lasse">>, <<"8081769683F73D76A718319A593F8551A0D3747404C51CCE5869CFC6AEDC7EDF">>},
{<<"lhttpc">>, <<"76B5FA6149D1E10D4B1FBC4EBD51D371DB19C1AB9F0A9ECF5B526440DF064E97">>},
Expand Down
Loading