mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-30 17:43:57 +01:00
Replace concat_binary supported until R14 with list_to_binary supported since R9
This commit is contained in:
parent
f36ac2b809
commit
6bde01cd45
@ -118,7 +118,7 @@ dec_attrs(<<>>, Msg) ->
|
|||||||
Msg.
|
Msg.
|
||||||
|
|
||||||
enc_attrs(Msg) ->
|
enc_attrs(Msg) ->
|
||||||
concat_binary(
|
list_to_binary(
|
||||||
[enc_attr(?STUN_ATTR_SOFTWARE, Msg#stun.'SOFTWARE'),
|
[enc_attr(?STUN_ATTR_SOFTWARE, Msg#stun.'SOFTWARE'),
|
||||||
enc_addr(?STUN_ATTR_MAPPED_ADDRESS, Msg#stun.'MAPPED-ADDRESS'),
|
enc_addr(?STUN_ATTR_MAPPED_ADDRESS, Msg#stun.'MAPPED-ADDRESS'),
|
||||||
enc_xor_addr(?STUN_ATTR_XOR_MAPPED_ADDRESS,
|
enc_xor_addr(?STUN_ATTR_XOR_MAPPED_ADDRESS,
|
||||||
@ -230,7 +230,7 @@ enc_unknown_attrs([]) ->
|
|||||||
<<>>;
|
<<>>;
|
||||||
enc_unknown_attrs(Attrs) ->
|
enc_unknown_attrs(Attrs) ->
|
||||||
enc_attr(?STUN_ATTR_UNKNOWN_ATTRIBUTES,
|
enc_attr(?STUN_ATTR_UNKNOWN_ATTRIBUTES,
|
||||||
concat_binary([<<Attr:16>> || Attr <- Attrs])).
|
list_to_binary([<<Attr:16>> || Attr <- Attrs])).
|
||||||
|
|
||||||
%%====================================================================
|
%%====================================================================
|
||||||
%% Auxiliary functions
|
%% Auxiliary functions
|
||||||
|
@ -99,12 +99,12 @@ make_text_node(CData) ->
|
|||||||
cdata ->
|
cdata ->
|
||||||
CDATA1 = <<"<![CDATA[">>,
|
CDATA1 = <<"<![CDATA[">>,
|
||||||
CDATA2 = <<"]]>">>,
|
CDATA2 = <<"]]>">>,
|
||||||
concat_binary([CDATA1, CData, CDATA2]);
|
list_to_binary([CDATA1, CData, CDATA2]);
|
||||||
none ->
|
none ->
|
||||||
CData;
|
CData;
|
||||||
{cdata, EndTokens} ->
|
{cdata, EndTokens} ->
|
||||||
EscapedCData = escape_cdata(CData, EndTokens),
|
EscapedCData = escape_cdata(CData, EndTokens),
|
||||||
concat_binary(EscapedCData)
|
list_to_binary(EscapedCData)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% Returns escape type needed for the text node
|
%% Returns escape type needed for the text node
|
||||||
|
@ -83,7 +83,7 @@ process_data(CallbackPid, Stack, Data) ->
|
|||||||
[{xmlelement, Name, Attrs,
|
[{xmlelement, Name, Attrs,
|
||||||
[{xmlcdata, PreviousCData}|Els]} | Tail] ->
|
[{xmlcdata, PreviousCData}|Els]} | Tail] ->
|
||||||
[{xmlelement, Name, Attrs,
|
[{xmlelement, Name, Attrs,
|
||||||
[{xmlcdata, concat_binary([PreviousCData, CData])} | Els]} | Tail];
|
[{xmlcdata, list_to_binary([PreviousCData, CData])} | Els]} | Tail];
|
||||||
%% No previous CDATA
|
%% No previous CDATA
|
||||||
[{xmlelement, Name, Attrs, Els} | Tail] ->
|
[{xmlelement, Name, Attrs, Els} | Tail] ->
|
||||||
[{xmlelement, Name, Attrs, [{xmlcdata, CData} | Els]} |
|
[{xmlelement, Name, Attrs, [{xmlcdata, CData} | Els]} |
|
||||||
|
Loading…
Reference in New Issue
Block a user