Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove the message size restriction and fix the validation of images #2472
changed the title
Changes the behavior for oversized messages and fix the validation of images
Jul 26, 2016
Code-wise, PR looks fine.
But we need to tread carefully to ensure we don't do something stupid. We need to test how Qt reacts with big HTML documents in the log view. That's the thing I worry about.
Alternatively, we could perhaps limit the documents by area instead of the arbitrary restrictions we currently use?
I'm thinking: the inserted log item must not exceed an area of 4096x4096 (16777216), or 2048x2048 (4194304) -- and perhaps those values are too optimistic. This would a square 2048x2048 log entry. But also a log entry that's sized at 300x11288, or at 11288x300 -- both areas are smaller than 4194304.
@SuperNascher I am more concerned about memory usage with large HTML messages, and log performance in general with big messages.
Have you tested any of that? :)
Also I'm interested HTML that displays something huge, but is actually very small in source form, i.e.
My first thought was, that it is not possible to use width and height to create large HTML elements. Qt allows the use of these styles only for pictures, tables and “horizontal rulers”. Another possibility to abuse the text messages is to use margin-* (margin-top, -bottom, etc.) and padding-* to “extend” the messages. Here are some examples:
And now comes the question, how Mumble should treat these messages. An approach to the solution could be to create a regexp filter that deletes the margin and padding styles before the validation of the message begins. Another possibility is that Mumble still checks if the message is smaller than the width of a half screen size. If the message is bigger than the message will be posted as HTML source code.
I am done with the tests. I used QElapsedTimer to track the executing time of validHtml and ps to track the process and memory usage.
Here is the source code for testing (works only on Unix systems): https://n0paste.tk/wNS2zJX/
I have tested three messages and these messages has been tested three times.
PR Client: The Client with this Pull Request
Summary of the messages
Sorry that I post the results today, but my first objective was to test the changes on a 1GZ ARM device, but the compilation for the device took to long, so I have used my PC.
Here are the test results of sending the message (
Mumble PR Client: The Client with this Pull Request