25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-07 14:58:56 +02:00

* src/xml_stream.erl: Group CDATA on a single xmlcdata node (splitting is not relevant as dependant on TCP/IP packet fragmentation) (EJAB-292).

SVN Revision: 839
This commit is contained in:
Mickaël Rémond 2007-07-30 10:06:49 +00:00
parent 3f51e73944
commit e9bbed2299
2 changed files with 13 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2007-07-30 Mickael Remond <mickael.remond@process-one.net>
* src/xml_stream.erl: Group CDATA on a single xmlcdata
node (splitting is not relevant as dependant on TCP/IP packet
fragmentation) (EJAB-292).
* src/xml.erl: Remove compilation warnings (EJAB-290).
* src/xml.erl: Do not crypt binary CData, but enclose the value in

View File

@ -59,6 +59,15 @@ process_data(CallbackPid, Stack, Data) ->
case Stack of
[El] ->
[El];
%% Merge CDATA nodes if they are contiguous
%% This does not change the semantic: the split in
%% several CDATA nodes depends on the TCP/IP packet
%% fragmentation
[{xmlelement, Name, Attrs,
[{xmlcdata, PreviousCData}|Els]} | Tail] ->
[{xmlelement, Name, Attrs,
[{xmlcdata, concat_binary([PreviousCData, CData])} | Els]} | Tail];
%% No previous CDATA
[{xmlelement, Name, Attrs, Els} | Tail] ->
[{xmlelement, Name, Attrs, [{xmlcdata, CData} | Els]} |
Tail];