1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-14 04:39:41 +02:00

SMACK-425 Introduced smack.parsing.ParsingExceptionCallback, a callback invoked when a exception is thrown while parsing a stanza. Smack is now able to either rethrow the exception ulitmatly causing a disconnect *or* log/ignore the exception and resume parsing after the faulty stanza.

Conflicts:
	source/org/jivesoftware/smack/SmackConfiguration.java

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13685 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Florian Schmaus 2013-06-22 17:00:27 +00:00 committed by flow
parent dac68c64a9
commit 4cd53e4419
12 changed files with 541 additions and 8 deletions

View file

@ -171,10 +171,13 @@ public class PacketParserUtils {
*/
private static String parseContent(XmlPullParser parser)
throws XmlPullParserException, IOException {
StringBuffer content = new StringBuffer();
int parserDepth = parser.getDepth();
while (!(parser.next() == XmlPullParser.END_TAG && parser
.getDepth() == parserDepth)) {
return parseContentDepth(parser, parserDepth);
}
public static String parseContentDepth(XmlPullParser parser, int depth) throws XmlPullParserException, IOException {
StringBuffer content = new StringBuffer();
while (!(parser.next() == XmlPullParser.END_TAG && parser.getDepth() == depth)) {
content.append(parser.getText());
}
return content.toString();