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