comparison libpurple/protocols/jabber/parser.c @ 32819:2c6510167895 default tip

propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24) to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 02 Jun 2012 02:30:49 +0000
parents a5b556ac1de5
children
comparison
equal deleted inserted replaced
32818:01ff09d4a463 32819:2c6510167895
50 /* We were expecting a <stream:stream/> opening stanza, but 50 /* We were expecting a <stream:stream/> opening stanza, but
51 * didn't get it. Bad! 51 * didn't get it. Bad!
52 */ 52 */
53 purple_debug_error("jabber", "Expecting stream header, got %s with " 53 purple_debug_error("jabber", "Expecting stream header, got %s with "
54 "xmlns %s\n", element_name, namespace); 54 "xmlns %s\n", element_name, namespace);
55 purple_connection_error_reason(js->gc, 55 purple_connection_error(js->gc,
56 PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE, 56 PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
57 _("XMPP stream header missing")); 57 _("XMPP stream header missing"));
58 return; 58 return;
59 } 59 }
60 60
71 js->protocol_version.major = atoi(attrib); 71 js->protocol_version.major = atoi(attrib);
72 js->protocol_version.minor = dot ? atoi(dot + 1) : 0; 72 js->protocol_version.minor = dot ? atoi(dot + 1) : 0;
73 73
74 if (js->protocol_version.major > 1) { 74 if (js->protocol_version.major > 1) {
75 /* TODO: Send <unsupported-version/> error */ 75 /* TODO: Send <unsupported-version/> error */
76 purple_connection_error_reason(js->gc, 76 purple_connection_error(js->gc,
77 PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE, 77 PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
78 _("XMPP Version Mismatch")); 78 _("XMPP Version Mismatch"));
79 g_free(attrib); 79 g_free(attrib);
80 return; 80 return;
81 } 81 }
96 if (js->stream_id == NULL) { 96 if (js->stream_id == NULL) {
97 #if 0 97 #if 0
98 /* This was underspecified in rfc3920 as only being a SHOULD, so 98 /* This was underspecified in rfc3920 as only being a SHOULD, so
99 * we cannot rely on it. See #12331 and Oracle's server. 99 * we cannot rely on it. See #12331 and Oracle's server.
100 */ 100 */
101 purple_connection_error_reason(js->gc, 101 purple_connection_error(js->gc,
102 PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE, 102 PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
103 _("XMPP stream missing ID")); 103 _("XMPP stream missing ID"));
104 #else 104 #else
105 /* Instead, let's make up a placeholder stream ID, which we need 105 /* Instead, let's make up a placeholder stream ID, which we need
106 * to do because we flag on it being NULL as a special case 106 * to do because we flag on it being NULL as a special case
298 case XML_ERR_ERROR: 298 case XML_ERR_ERROR:
299 purple_debug_error("jabber", "xmlParseChunk returned error %i\n", ret); 299 purple_debug_error("jabber", "xmlParseChunk returned error %i\n", ret);
300 break; 300 break;
301 case XML_ERR_FATAL: 301 case XML_ERR_FATAL:
302 purple_debug_error("jabber", "xmlParseChunk returned fatal %i\n", ret); 302 purple_debug_error("jabber", "xmlParseChunk returned fatal %i\n", ret);
303 purple_connection_error_reason (js->gc, 303 purple_connection_error (js->gc,
304 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, 304 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
305 _("XML Parse error")); 305 _("XML Parse error"));
306 break; 306 break;
307 } 307 }
308 } 308 }