Added new stanza for error responce, libstrophe now will be responce <stream:error> if parser failed

This commit is contained in:
Ilya Orlov
2017-09-04 11:46:09 +03:00
parent d0644c5e95
commit 032e8ec89d
6 changed files with 132 additions and 6 deletions

View File

@@ -262,10 +262,8 @@ void xmpp_run_once(xmpp_ctx_t *ctx, const unsigned long timeout)
if (ret > 0) {
ret = parser_feed(conn->parser, buf, ret);
if (!ret) {
/* parse error, we need to shut down */
/* FIXME */
xmpp_debug(ctx, "xmpp", "parse error, disconnecting");
conn_disconnect(conn);
xmpp_debug(ctx, "xmpp", "parse error [%s]", buf);
xmpp_send_error(conn, XMPP_SE_INVALID_XML, "parse error");
}
} else {
if (conn->tls) {