mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
Recompile the xmpp_codec using updated XML generator
This commit is contained in:
parent
2cb0f92fe6
commit
bfd028beea
@ -519,16 +519,16 @@ sm(Config) ->
|
||||
Msg = #message{to = ServerJID, body = [#text{data = <<"body">>}]},
|
||||
true = ?config(sm, Config),
|
||||
%% Enable the session management with resumption enabled
|
||||
send(Config, #sm_enable{resume = true}),
|
||||
send(Config, #sm_enable{resume = true, xmlns = ?NS_STREAM_MGMT_3}),
|
||||
#sm_enabled{id = ID, resume = true} = recv(),
|
||||
%% Initial request; 'h' should be 0.
|
||||
send(Config, #sm_r{}),
|
||||
send(Config, #sm_r{xmlns = ?NS_STREAM_MGMT_3}),
|
||||
#sm_a{h = 0} = recv(),
|
||||
%% sending two messages and requesting again; 'h' should be 3.
|
||||
send(Config, Msg),
|
||||
send(Config, Msg),
|
||||
send(Config, Msg),
|
||||
send(Config, #sm_r{}),
|
||||
send(Config, #sm_r{xmlns = ?NS_STREAM_MGMT_3}),
|
||||
#sm_a{h = 3} = recv(),
|
||||
close_socket(Config),
|
||||
{save_config, set_opt(sm_previd, ID, Config)}.
|
||||
@ -543,11 +543,11 @@ sm_resume(Config) ->
|
||||
Msg = #message{from = ServerJID, to = MyJID, body = [Txt]},
|
||||
%% Route message. The message should be queued by the C2S process.
|
||||
ejabberd_router:route(ServerJID, MyJID, xmpp_codec:encode(Msg)),
|
||||
send(Config, #sm_resume{previd = ID, h = 0}),
|
||||
send(Config, #sm_resume{previd = ID, h = 0, xmlns = ?NS_STREAM_MGMT_3}),
|
||||
#sm_resumed{previd = ID, h = 3} = recv(),
|
||||
#message{from = ServerJID, to = MyJID, body = [Txt]} = recv(),
|
||||
#sm_r{} = recv(),
|
||||
send(Config, #sm_a{h = 1}),
|
||||
send(Config, #sm_a{h = 1, xmlns = ?NS_STREAM_MGMT_3}),
|
||||
disconnect(Config).
|
||||
|
||||
private(Config) ->
|
||||
|
16128
tools/xmpp_codec.erl
16128
tools/xmpp_codec.erl
File diff suppressed because it is too large
Load Diff
@ -13,7 +13,8 @@
|
||||
port = 1080 :: non_neg_integer()}).
|
||||
|
||||
-record(sm_resume, {h :: non_neg_integer(),
|
||||
previd :: binary()}).
|
||||
previd :: binary(),
|
||||
xmlns :: binary()}).
|
||||
|
||||
-record(carbons_enable, {}).
|
||||
|
||||
@ -40,18 +41,21 @@
|
||||
from :: any(),
|
||||
to :: any()}).
|
||||
|
||||
-record(sm_a, {h :: non_neg_integer()}).
|
||||
-record(sm_a, {h :: non_neg_integer(),
|
||||
xmlns :: binary()}).
|
||||
|
||||
-record(starttls_proceed, {}).
|
||||
|
||||
-record(sm_resumed, {h :: non_neg_integer(),
|
||||
previd :: binary()}).
|
||||
previd :: binary(),
|
||||
xmlns :: binary()}).
|
||||
|
||||
-record(forwarded, {delay :: #delay{},
|
||||
sub_els = [] :: [any()]}).
|
||||
|
||||
-record(sm_enable, {max :: non_neg_integer(),
|
||||
resume = false :: any()}).
|
||||
resume = false :: any(),
|
||||
xmlns :: binary()}).
|
||||
|
||||
-record(starttls_failure, {}).
|
||||
|
||||
@ -63,7 +67,7 @@
|
||||
|
||||
-record(p1_ack, {}).
|
||||
|
||||
-record(feature_sm, {}).
|
||||
-record(feature_sm, {xmlns :: binary()}).
|
||||
|
||||
-record(pubsub_item, {id :: binary(),
|
||||
xml_els = [] :: [any()]}).
|
||||
@ -84,7 +88,7 @@
|
||||
node :: binary(),
|
||||
publisher :: binary()}).
|
||||
|
||||
-record(sm_r, {}).
|
||||
-record(sm_r, {xmlns :: binary()}).
|
||||
|
||||
-record(muc_actor, {jid :: any(),
|
||||
nick :: binary()}).
|
||||
@ -108,7 +112,8 @@
|
||||
-record(sm_enabled, {id :: binary(),
|
||||
location :: binary(),
|
||||
max :: non_neg_integer(),
|
||||
resume = false :: any()}).
|
||||
resume = false :: any(),
|
||||
xmlns :: binary()}).
|
||||
|
||||
-record(pubsub_event_items, {node :: binary(),
|
||||
retract = [] :: [binary()],
|
||||
@ -378,7 +383,8 @@
|
||||
|
||||
-record(sasl_mechanisms, {list = [] :: [binary()]}).
|
||||
|
||||
-record(sm_failed, {reason :: atom() | #gone{} | #redirect{}}).
|
||||
-record(sm_failed, {reason :: atom() | #gone{} | #redirect{},
|
||||
xmlns :: binary()}).
|
||||
|
||||
-record(error, {type :: 'auth' | 'cancel' | 'continue' | 'modify' | 'wait',
|
||||
by :: binary(),
|
||||
|
@ -2070,16 +2070,18 @@
|
||||
|
||||
-xml(feature_sm,
|
||||
#elem{name = <<"sm">>,
|
||||
xmlns = <<"urn:xmpp:sm:3">>,
|
||||
result = {feature_sm}}).
|
||||
xmlns = [<<"urn:xmpp:sm:2">>, <<"urn:xmpp:sm:3">>],
|
||||
result = {feature_sm, '$xmlns'},
|
||||
attrs = [#attr{name = <<"xmlns">>}]}).
|
||||
|
||||
-xml(sm_enable,
|
||||
#elem{name = <<"enable">>,
|
||||
xmlns = <<"urn:xmpp:sm:3">>,
|
||||
result = {sm_enable, '$max', '$resume'},
|
||||
xmlns = [<<"urn:xmpp:sm:2">>, <<"urn:xmpp:sm:3">>],
|
||||
result = {sm_enable, '$max', '$resume', '$xmlns'},
|
||||
attrs = [#attr{name = <<"max">>,
|
||||
dec = {dec_int, [0, infinity]},
|
||||
enc = {enc_int, []}},
|
||||
#attr{name = <<"xmlns">>},
|
||||
#attr{name = <<"resume">>,
|
||||
default = false,
|
||||
dec = {dec_bool, []},
|
||||
@ -2087,10 +2089,11 @@
|
||||
|
||||
-xml(sm_enabled,
|
||||
#elem{name = <<"enabled">>,
|
||||
xmlns = <<"urn:xmpp:sm:3">>,
|
||||
result = {sm_enabled, '$id', '$location', '$max', '$resume'},
|
||||
xmlns = [<<"urn:xmpp:sm:2">>, <<"urn:xmpp:sm:3">>],
|
||||
result = {sm_enabled, '$id', '$location', '$max', '$resume', '$xmlns'},
|
||||
attrs = [#attr{name = <<"id">>},
|
||||
#attr{name = <<"location">>},
|
||||
#attr{name = <<"xmlns">>},
|
||||
#attr{name = <<"max">>,
|
||||
dec = {dec_int, [0, infinity]},
|
||||
enc = {enc_int, []}},
|
||||
@ -2101,44 +2104,49 @@
|
||||
|
||||
-xml(sm_resume,
|
||||
#elem{name = <<"resume">>,
|
||||
xmlns = <<"urn:xmpp:sm:3">>,
|
||||
result = {sm_resume, '$h', '$previd'},
|
||||
xmlns = [<<"urn:xmpp:sm:2">>, <<"urn:xmpp:sm:3">>],
|
||||
result = {sm_resume, '$h', '$previd', '$xmlns'},
|
||||
attrs = [#attr{name = <<"h">>,
|
||||
required = true,
|
||||
dec = {dec_int, [0, infinity]},
|
||||
enc = {enc_int, []}},
|
||||
#attr{name = <<"xmlns">>},
|
||||
#attr{name = <<"previd">>,
|
||||
required = true}]}).
|
||||
|
||||
-xml(sm_resumed,
|
||||
#elem{name = <<"resumed">>,
|
||||
xmlns = <<"urn:xmpp:sm:3">>,
|
||||
result = {sm_resumed, '$h', '$previd'},
|
||||
xmlns = [<<"urn:xmpp:sm:2">>, <<"urn:xmpp:sm:3">>],
|
||||
result = {sm_resumed, '$h', '$previd', '$xmlns'},
|
||||
attrs = [#attr{name = <<"h">>,
|
||||
required = true,
|
||||
dec = {dec_int, [0, infinity]},
|
||||
enc = {enc_int, []}},
|
||||
#attr{name = <<"xmlns">>},
|
||||
#attr{name = <<"previd">>,
|
||||
required = true}]}).
|
||||
|
||||
-xml(sm_r,
|
||||
#elem{name = <<"r">>,
|
||||
xmlns = <<"urn:xmpp:sm:3">>,
|
||||
result = {sm_r}}).
|
||||
xmlns = [<<"urn:xmpp:sm:2">>, <<"urn:xmpp:sm:3">>],
|
||||
result = {sm_r, '$xmlns'},
|
||||
attrs = [#attr{name = <<"xmlns">>}]}).
|
||||
|
||||
-xml(sm_a,
|
||||
#elem{name = <<"a">>,
|
||||
xmlns = <<"urn:xmpp:sm:3">>,
|
||||
result = {sm_a, '$h'},
|
||||
xmlns = [<<"urn:xmpp:sm:2">>, <<"urn:xmpp:sm:3">>],
|
||||
result = {sm_a, '$h', '$xmlns'},
|
||||
attrs = [#attr{name = <<"h">>,
|
||||
required = true,
|
||||
dec = {dec_int, [0, infinity]},
|
||||
enc = {enc_int, []}}]}).
|
||||
enc = {enc_int, []}},
|
||||
#attr{name = <<"xmlns">>}]}).
|
||||
|
||||
-xml(sm_failed,
|
||||
#elem{name = <<"failed">>,
|
||||
xmlns = <<"urn:xmpp:sm:3">>,
|
||||
result = {sm_failed, '$reason'},
|
||||
xmlns = [<<"urn:xmpp:sm:2">>, <<"urn:xmpp:sm:3">>],
|
||||
result = {sm_failed, '$reason', '$xmlns'},
|
||||
attrs = [#attr{name = <<"xmlns">>}],
|
||||
refs = [#ref{name = error_bad_request,
|
||||
min = 0, max = 1, label = '$reason'},
|
||||
#ref{name = error_conflict,
|
||||
|
Loading…
Reference in New Issue
Block a user