[Xml-compile] Make sure not to block, like on loading external DTDs

Mark Overmeer mark at overmeer.net
Tue Feb 21 11:57:45 GMT 2012


* Michael Ludwig (m.ludwig at epages.com) [120221 10:43]:
> What matters is that if an error occurs, it may take several
> forms. The service may brutally close the socket, a condition
> that is immediately detected, so we know there's an error.
> 
>   error: read error
> 
> The service may also reply with an HTML document:
> 
>   warning: Internal Server Error
>   error: answer is not xml but `text/html'
> 
> Now I haven't debugged this, but under some circumstances
> there's a long wait because something tries to get the HTML
> DTD from the W3C website, and they have you wait deliberately
> so you learn not to load the DTD from their site, and why
> would you?

Ah, so when the answer is not XML and then you pretty_print
the response body, you get this delay.  Maybe we should refuse
pretty-printing anything else than xml...

> my %opt = (load_ext_dtd => 0, recover => 1);
>   no_network => 1
> XML::LibXML->load_xml(location => shift, %opt)->toFH(*STDERR, 1);

patch applied twice.
-- 
Regards,
               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list