Re: Problem timing out XML::LibXML parse_html_string call
Bjoern Hoehrmann <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
* Sam Tregar wrote: >Thanks! This does indeed work. I'm still in the market for a safer >solution if anyone has one, but this will do for now. The fault here lies with libxml2 which goes into an infinite loop, at least as far as I can tell from running your document through xmllint. The library reports an error "Excessive depth in document" before it goes into the loop, perhaps you can wait for this error and abort if you get it. The proper solution would be to file a bug with libxml2 and use a fixed version. It may also be possible to run the parsing code in a separate thread or process, and kill it as desired. Though mixing Perl and threads and XS can easily become problematic. -- Björn Höhrmann · mailto:[email protected] · http://bjoern.hoehrmann.de Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de 25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ _______________________________________________ Perl-XML mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs