Last week I took the plunge and tried to get HTML mail working.
As an early internet adaptor and ex Pine user, I still have mixed feelings about HTML mail, but it’s just so much eaiser to read, esp. with newsletters, that I cannot deny its usefulness.
Coming back to local mail with Haiku - getting more everyday capable every day…
- I missed the nice renderin in GMail, so I set out to find a lightweight, easy to port HTML rendering library without dragging in webkit or other high profile browser engines.
I quickly found out there was an older and incomplete libhtml port by @adamfowleruk so I forked it and made it consume my latest port of liblitehtml 0.9.
I cleaned up the CMake config and made it behave properly under Haiku, added native support for libnet2 and using the new but still private BNetwork API.
It looks already quite nice, consuming local and remote images, loading style sheets and all.
However, coming to the point, I get this strange heap memory corruption with remote requests, when the local (!) BHttpRequest object is destroyed at the end of the scope:
../haiku-git/src/system/libroot/posix/malloc/hoard2/superblock.h:273:int BPrivate::superblock::isValid(): _numAvailable <= _numBlocks
This seems to be a race condition but I’m using the synchronous API so the method shouldn’t exit before the object is destroyed…
Yesterday I had this working with all web sites I tested, but today after changing some logic it always crashes on external sites (only then the HttpRequest is used, obviously).
Any idea what I’m doing wrong here?
You can find the code in question here:




