From 054927a6788178ca276d88b5c8d8883f2b36fa25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Thu, 6 Jun 2024 12:50:46 +0200 Subject: [PATCH] Disable reparse deferral in expat 2.6+ This fixes issue #48, and also due nature of xmpp xml streams, we can also trigger that for real traffic that we handle. --- c_src/fxml_stream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/c_src/fxml_stream.c b/c_src/fxml_stream.c index b4ca6b1..f75e203 100644 --- a/c_src/fxml_stream.c +++ b/c_src/fxml_stream.c @@ -781,6 +781,9 @@ static void setup_parser(state_t *state) erlXML_StartDoctypeDeclHandler); XML_SetReturnNSTriplet(state->parser, 1); XML_SetDefaultHandler(state->parser, (XML_DefaultHandler) erlXML_DefaultHandler); +#if XML_MAJOR_VERSION > 2 || (XML_MAJOR_VERSION == 2 && XML_MINOR_VERSION >= 6) + XML_SetReparseDeferralEnabled(state->parser, XML_FALSE); +#endif } static state_t *init_parser_state(ErlNifPid *pid)