Mercurial > pidgin.yaz
changeset 14476:218a36c1c9e2
[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 <tailor@pidgin.im>
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Fri, 08 Sep 2006 22:47:36 +0000 |
parents | feedb7828791 |
children | ca36763497d9 |
files | libgaim/protocols/jabber/parser.c |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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")); }