Converted these images to PNG, saving a handful of bytes per image
[adiumx.git] / Utilities / dep-build-scripts / libpurple_jabber_parser_error_handler.diff
blob5671ee82d8ba4b3e215dbbb5b16e087fd173ebed
2 # old_revision [20e2add42a314b4914e798757eb2a69ac3b491d0]
4 # patch "libpurple/protocols/jabber/parser.c"
5 # from [6cecb079972daf216504b3dce358ca781c92c3d9]
6 # to [d66cc169b95ef6131b2369df7ca32a04ca475f49]
8 ============================================================
9 --- libpurple/protocols/jabber/parser.c 6cecb079972daf216504b3dce358ca781c92c3d9
10 +++ libpurple/protocols/jabber/parser.c d66cc169b95ef6131b2369df7ca32a04ca475f49
11 @@ -132,6 +132,18 @@ jabber_parser_element_text_libxml(void *
12 xmlnode_insert_data(js->current, (const char*) text, text_len);
15 +static void
16 +jabber_parser_structured_error_handler(void *user_data, xmlErrorPtr error)
18 + JabberStream *js = user_data;
20 + purple_debug_error("jabber", "XML parser error for JabberStream %p: "
21 + "Domain %i, code %i, level %i: %s\n",
22 + js,
23 + error->domain, error->code, error->level,
24 + (error->message ? error->message : "(null)"));
27 static xmlSAXHandler jabber_parser_libxml = {
28 .internalSubset = NULL,
29 .isStandalone = NULL,
30 @@ -164,7 +176,7 @@ static xmlSAXHandler jabber_parser_libxm
31 ._private = NULL,
32 .startElementNs = jabber_parser_element_start_libxml,
33 .endElementNs = jabber_parser_element_end_libxml,
34 - .serror = NULL
35 + .serror = jabber_parser_structured_error_handler
38 void
39 @@ -179,6 +191,7 @@ void jabber_parser_free(JabberStream *js
41 void jabber_parser_free(JabberStream *js) {
42 if (js->context) {
43 + xmlSetStructuredErrorFunc(NULL, jabber_parser_structured_error_handler);
44 xmlParseChunk(js->context, NULL,0,1);
45 xmlFreeParserCtxt(js->context);
46 js->context = NULL;
47 @@ -187,6 +200,8 @@ void jabber_parser_process(JabberStream
49 void jabber_parser_process(JabberStream *js, const char *buf, int len)
51 + xmlSetStructuredErrorFunc(NULL, jabber_parser_structured_error_handler);
53 if (js->context == NULL) {
54 /* libxml inconsistently starts parsing on creating the
55 * parser, so do a ParseChunk right afterwards to force it. */