1. Peter Hosey
  2. LMX
  3. Issues
Issue #3 new

Error if a data chunk breaks an entity

Evan Schoenberg
created an issue

LMX is supposed to be able to take data in chunks, from the end of the file. It turns out that this doesn't work if a chunk breaks up an entity, though.

I have access to a log which reproduces the behavior, at least on my own machine (your mileage would vary depending on the return value of getpagesize()) when read by Adium's -[DCMessageContextDisplayPlugin contextForChat:], since that method reads in 4*getpagesize() byte chunks and that number of bytes from the end is the middle of an entity.

Specifically, the resulting chunk #1 starts with 'apos'. The resulting chunk #2 ends with '&'.

The result is an assertion failure: *** Assertion failure in -[LMXParser parseEntityReference:], /Volumes/Huffman/Projects/lmx-sholt/LMXParser.m:605 "entity name was empty! currentIndex is 5193 (&) out of 21579 bytes"

This issue was also relayed to the Adium development mailing list on 4/26/10. Adium ticket #13628 (http://trac.adium.im/ticket/13628) is the relevant Adium ticket; it has been closed via a workaround, obsoleted by this ticket which relates to the actual problem.

Comments (1)

  1. Evan Schoenberg reporter

    boredzo wrote on the Adium development list: "The fix is to copy the current entity-name run into the entityName string when the chunk runs out. This step is intended but currently missing (I apparently forgot to write it)."

  2. Log in to comment