Skip to content

Commit

Permalink
Disable reparse deferral in expat 2.6+
Browse files Browse the repository at this point in the history
This fixes issue #48, and also due nature of xmpp xml streams, we can
also trigger that for real traffic that we handle.
  • Loading branch information
prefiks committed Jun 6, 2024
1 parent e5f4f69 commit 054927a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions c_src/fxml_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 054927a

Please sign in to comment.