1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Fix END_DOCUMENT handling in XMPPTCPConnection

The 'break' statement in the END_DOCUMENT case should break the parsing
loop and not the switch/case within. Therefore we need to add a loop
label on break on that label.
This commit is contained in:
Florian Schmaus 2014-11-12 17:36:25 +01:00
parent def8fea05f
commit 301519a264

View file

@ -971,7 +971,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
try {
initalOpenStreamSend.checkIfSuccessOrWait();
int eventType = parser.getEventType();
while (!done) {
outerloop: while (!done) {
switch (eventType) {
case XmlPullParser.START_TAG:
final String name = parser.getName();
@ -1162,10 +1162,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
}
break;
case XmlPullParser.END_DOCUMENT:
// This should not happen, log a warning and disconnect()
LOGGER.warning("Got END_DOCUMENT, aborting parsing");
disconnect();
break;
LOGGER.warning("Got END_DOCUMENT, aborting parsing and calling instantShutdown");
// Use instantShutdown() because we want to keep the stream state if possible
instantShutdown();
break outerloop;
}
eventType = parser.next();
}