mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-25 21:42:07 +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 {
|
try {
|
||||||
initalOpenStreamSend.checkIfSuccessOrWait();
|
initalOpenStreamSend.checkIfSuccessOrWait();
|
||||||
int eventType = parser.getEventType();
|
int eventType = parser.getEventType();
|
||||||
while (!done && eventType != XmlPullParser.END_DOCUMENT) {
|
while (!done) {
|
||||||
switch (eventType) {
|
switch (eventType) {
|
||||||
case XmlPullParser.START_TAG:
|
case XmlPullParser.START_TAG:
|
||||||
final String name = parser.getName();
|
final String name = parser.getName();
|
||||||
|
@ -1207,6 +1207,11 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
disconnect();
|
disconnect();
|
||||||
}
|
}
|
||||||
break;
|
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();
|
eventType = parser.next();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue