← Back to team overview

linuxdcpp-team team mailing list archive

[Bug 2071439] [NEW] Long and continous chat messages are not displayed at all or getting truncated in some cases.

 

Public bug reported:

The error actually happens when a ChatMessage has a html text element that contains a 65535+ character long continous text block, not broken by any (link or other) tag.
Only a continous chat message text chunk of size of 64KiB+, without any links, URIs, etc... in it can produce this error. 
In this scenario the whole block (or the whole message, if it consists of only one of such long block) is getting lost and a SimleXMLException error message is printed to the chat window.

The problem is that parsing of content of this size is currently over
the limits of SimpleXMLReader. It seems like some hubs allow such large
messages though or their (feed or similar) bots may purposedly generate
such large content in their normal operation.

The maximum content length a RichTextBox can currently hold is 128 KiB
but the default maximum protocol command length (512 KiB) allows even
larger chat messages to reach the HTMLtoRtf process.

One possible solution to the problem is to split any continous 64KiB+
message values inside the html element to less than 64 KiB long pieces
by embedding empty <span> tags into them.

Another solution is to add a new option to SimpleXMLReader that would
- double the maximum output value/content size allowed
- and handle output buffer overlow errors more gracefully
so the already parsed content up to the (now extended) size limit is not getting lost even when the message is still too long.

Included a patch implementing the latter solution where it is set that
only HtmlToRtf, which emits already processed and UTF-8 verified safe
input data to the parser uses this new option.

** Affects: dcplusplus
     Importance: Medium
     Assignee: eMTee (realprogger)
         Status: Confirmed

** Patch added: "SXML_ChatMessage_fix.patch"
   https://bugs.launchpad.net/bugs/2071439/+attachment/5793069/+files/SXML_ChatMessage_fix.patch

-- 
You received this bug notification because you are a member of
Dcplusplus-team, which is subscribed to DC++.
https://bugs.launchpad.net/bugs/2071439

Title:
  Long and continous chat messages are not displayed at all or getting
  truncated in some cases.

Status in DC++:
  Confirmed

Bug description:
  The error actually happens when a ChatMessage has a html text element that contains a 65535+ character long continous text block, not broken by any (link or other) tag.
  Only a continous chat message text chunk of size of 64KiB+, without any links, URIs, etc... in it can produce this error. 
  In this scenario the whole block (or the whole message, if it consists of only one of such long block) is getting lost and a SimleXMLException error message is printed to the chat window.

  The problem is that parsing of content of this size is currently over
  the limits of SimpleXMLReader. It seems like some hubs allow such
  large messages though or their (feed or similar) bots may purposedly
  generate such large content in their normal operation.

  The maximum content length a RichTextBox can currently hold is 128 KiB
  but the default maximum protocol command length (512 KiB) allows even
  larger chat messages to reach the HTMLtoRtf process.

  One possible solution to the problem is to split any continous 64KiB+
  message values inside the html element to less than 64 KiB long pieces
  by embedding empty <span> tags into them.

  Another solution is to add a new option to SimpleXMLReader that would
  - double the maximum output value/content size allowed
  - and handle output buffer overlow errors more gracefully
  so the already parsed content up to the (now extended) size limit is not getting lost even when the message is still too long.

  Included a patch implementing the latter solution where it is set that
  only HtmlToRtf, which emits already processed and UTF-8 verified safe
  input data to the parser uses this new option.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dcplusplus/+bug/2071439/+subscriptions



Follow ups