# HG changeset patch # User Etan Reisner # Date 1157755656 0 # Node ID 218a36c1c9e2f923e16c78e6cbd580bc824fdded # Parent feedb78287915b8826f3b5d6b5663d0da8ed7232 [gaim-migrate @ 17194] The signal to noise ratio here isn't very good, but I hate comments that don't wrap cleanly. Anyway, apparently libxml2 has intermittent start-parsing errors, so we need to force it to actually start with this line. Sean pulled it out a bit ago but that was causing issues with logins just hanging sometimes. committer: Tailor Script diff -r feedb7828791 -r 218a36c1c9e2 libgaim/protocols/jabber/parser.c --- a/libgaim/protocols/jabber/parser.c Fri Sep 08 14:43:34 2006 +0000 +++ b/libgaim/protocols/jabber/parser.c Fri Sep 08 22:47:36 2006 +0000 @@ -156,10 +156,10 @@ void jabber_parser_setup(JabberStream *js) { - /* This seems backwards, but it makes sense. The libxml code creates the parser - * context when you try to use it (this way, it can figure out the encoding at - * creation time. So, setting up the parser is just a matter of destroying any - * current parser. */ + /* This seems backwards, but it makes sense. The libxml code creates + * the parser context when you try to use it (this way, it can figure + * out the encoding at creation time. So, setting up the parser is + * just a matter of destroying any current parser. */ if (js->context) { xmlParseChunk(js->context, NULL,0,1); xmlFreeParserCtxt(js->context); @@ -171,9 +171,10 @@ void jabber_parser_process(JabberStream *js, const char *buf, int len) { if (js->context == NULL) { - /* libxml inconsistently starts parsing on creating the parser, so so a ParseChunk - * right afterwards to force it. */ + /* libxml inconsistently starts parsing on creating the + * parser, so do a ParseChunk right afterwards to force it. */ js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL); + xmlParseChunk(js->context, NULL, 0, 0); } else if (xmlParseChunk(js->context, buf, len, 0) < 0) { gaim_connection_error(js->gc, _("XML Parse error")); }