1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 10:49: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.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_1@13688 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Florian Schmaus 2013-06-22 17:01:40 +00:00 committed by flow
parent 18a603d932
commit 30bc5afa2b
12 changed files with 524 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();