will cause Smack to disconnect. Packet parsing must keep track of depth to correctly figure out end tags.
This means that condition to determine the end tag also needs to check if the tag's name matches, which is already done, and that the depth must be the same as the corresponding start tag.
Message parsing has been adopted to look for the depth. Note that the example in the issue with <message><body><body/></body></message> will still cause a parsing exception, as it is invalid XMPP XML: body elements must not contain mixed mode XML.
Paul Johe
May 14, 2006 at 7:36 PM
I have a suggestion to help resolve this issue. Use a customized MXParser:
@Override public int next() throws XmlPullParserException, IOException { int ret = super.next(); if (ret == START_TAG) depth++; if (ret == END_TAG) depth--; return ret; }
@Override public int nextTag() throws XmlPullParserException, IOException { int ret = next(); if (ret == START_TAG || ret == END_TAG) return ret; throw new XmlPullParserException("The next tag was not a start or end tag."); }
/**
Get the current depth of the parser * @return int */ public int getDepth() { return depth; } }
A packet with:
will cause Smack to disconnect. Packet parsing must keep track of depth to correctly figure out end tags.
This means that condition to determine the end tag also needs to check if the tag's name matches, which is already done, and that the depth must be the same as the corresponding start tag.