mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-21 22:02:06 +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:
parent
def8fea05f
commit
301519a264
1 changed files with 5 additions and 5 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue