After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 113580 - Reader interface blocks on the end of node containing CDATA
Reader interface blocks on the end of node containing CDATA
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
2.5.2
Other other
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
: 113578 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-05-23 07:48 UTC by Jacek Konieczny
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test script for the bug (669 bytes, text/plain)
2003-05-23 07:49 UTC, Jacek Konieczny
  Details
Imroved "dont block" patch (464 bytes, patch)
2003-05-23 14:00 UTC, Jacek Konieczny
none Details | Review

Description Jacek Konieczny 2003-05-23 07:48:24 UTC
Reader read operation interface doesn't properly return end of CDATA/text
and end of node containind CDATA/text. Such element is returned after next
tag is encountered and interface is blocked until then. This make real-time
(or "as it cames") XML stream processing impossible.
(Bug report for version 2.5.7, which was not available on bugzilla)
A python test program and patch are attached.

The test program reads text from terminal and writes what it sees (in
brackets).

The "conversation" should look like this (text ouside braces is the input
from keyboard):
<a>{0,1,a}<b>{1,1,b}some text<{2,3,#text}/b>{1,15,b}<c/>{1,1,c}</a>{0,15,a}
But it looks like this:
<a>{0,1,a}<b>{1,1,b}some text</b><c/>{2,3,#text}{1,15,b}{1,1,c}</a>{0,15,a}

As you see "some text" and "</b>" are not noticed before "<c/>" is entered.
Comment 1 Jacek Konieczny 2003-05-23 07:49:22 UTC
Created attachment 16765 [details]
Test script for the bug
Comment 2 Jacek Konieczny 2003-05-23 13:58:05 UTC
It seems it xmlTextReaderExpand() is broken, because it seeks for the
next element instead of checking if current node is finished. The
previosly attached patch "fixed" Read(), so it doesn't call Expand()
and doesn't block in it. But Expand() was still broken and blocking.

I made new patch, probably more correct, which fixes DoExpand() to
check depth of parser context, when it is the same as current node it
means the node is readed completely. With this patch both Read() and
Expand() work correctly. The patch is attached.
Comment 3 Jacek Konieczny 2003-05-23 14:00:27 UTC
Created attachment 16774 [details] [review]
Imroved "dont block" patch
Comment 4 Daniel Veillard 2003-06-09 09:16:02 UTC
Okay I applied the patch, but in general you can't rely on
the instant delivery of an XML substructure from the parser,
any layer inbetween may delay the delivery: network, I/O, 
encoding conversion, buffering in the parser, etc ... This is 
IMHO the major flaw of Jabber, that for working correctly one
must deactivate any buffering, making it unsuitable for some
processors and killing performances because this destroy locality
and buffering.

Daniel
Comment 5 Daniel Veillard 2003-06-09 10:14:48 UTC
*** Bug 113578 has been marked as a duplicate of this bug. ***
Comment 6 Daniel Veillard 2003-07-07 14:16:38 UTC
this should be closed by release of libxml2-2.5.8
                                                                     
          
  thanks,
                                                                     
          
Daniel