mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-24 23:32:05 +01:00
Don't check for END_DOCUMENT parsePackets()
instead use the event switch/case and log a warning if this ever happens, as it's likely a programming error.
This commit is contained in:
parent
e090067358
commit
5f9c342f7e
1 changed files with 6 additions and 1 deletions
|
@ -1010,7 +1010,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
try {
|
||||
initalOpenStreamSend.checkIfSuccessOrWait();
|
||||
int eventType = parser.getEventType();
|
||||
while (!done && eventType != XmlPullParser.END_DOCUMENT) {
|
||||
while (!done) {
|
||||
switch (eventType) {
|
||||
case XmlPullParser.START_TAG:
|
||||
final String name = parser.getName();
|
||||
|
@ -1207,6 +1207,11 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
disconnect();
|
||||
}
|
||||
break;
|
||||
case XmlPullParser.END_DOCUMENT:
|
||||
// This should not happen, log a warning and disconnect()
|
||||
LOGGER.warning("Got END_DOCUMENT, aborting parsing");
|
||||
disconnect();
|
||||
break;
|
||||
}
|
||||
eventType = parser.next();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue