Re: [gmime-devel] GMimeFilterHTML: ignoring URL at the end of part?



Hi Gaute,

I suspect that the problem is that you are pulling data through the filter as opposed to pushing data through it. The complete() method of the GMimeFilterHTML filter is probably not getting called when the end of the stream has been reached (which it needs in order to recognize that the url is complete).

If this is the case, then it's a bug in GMime, but I'm not sure where. The bug is probably in GMimeStreamFilter's stream_read() implementation, but I do not currently have a development machine that I can use to test/debug this.

If you could step through gmime-stream-filter.c's stream_read() in a debugger and see if the code-path that calls the complete() method on each filter is called, that would at least tell us if my theory is correct or if it is actually a bug in GMimeFilterHTML's logic instead.

Thanks,

Jeff

On 9/10/2014 3:56 AM, Gaute Hope wrote:
Hi,

I'm parsing an email message that came in as a GitHub comment. I want to
get the plain-text part converted to HTML (yes, I know there is an HTML
part I could have used).

However, when I try to convert the plain-text to HTML by using the
GMimeFilterHTML I end up with missing the plain-text link that is at
the very end of the message. It seems to be simply ignored. I have tried
turning on-off some of the filter options, but to no avail.

I am using a gmime_iostream wrapper [0] or originally from [1], the code
that does the parsing is also online [2].

If I add a newline to the message source right before the second:
----==_mimepart_540ffd23a9176_53cd3ffb4d3fb2bc2852c3

the message parses as it should. Is this something I am doing wrong or
is this a bug?

Excerpts of the problematic email is included below, hopefully this is
sufficient to show the problem.

[0] https://github.com/gauteh/astroid/blob/master/src/gmime_iostream.cc
[1] http://the-ner.org/
[2] https://github.com/gauteh/astroid/blob/master/src/chunk.cc#L137


Cheers, Gaute


Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_540ffd23a9176_53cd3ffb4d3fb2bc2852c3";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list


----==_mimepart_540ffd23a9176_53cd3ffb4d3fb2bc2852c3
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

messagecontent.

---
Reply to this email directly or view it on GitHub:
https://github.com/sup-heliotrope/sup/issues/326#issuecomment-55080027
----==_mimepart_540ffd23a9176_53cd3ffb4d3fb2bc2852c3
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit

<p>messagecontent</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/sup-heliotrope/sup/issues/326#issuecomment-55080027";>view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/56827__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyNTk1MzE4NywiZGF0YSI6eyJpZCI6NDIwNDY3OTZ9fQ==--81335445e04e60c40309a26418c095a0a3c8c1e8.gif"; width="1" /></p>
----==_mimepart_540ffd23a9176_53cd3ffb4d3fb2bc2852c3--



_______________________________________________
gmime-devel-list mailing list
gmime-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gmime-devel-list



Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]