diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/xml/TagWriter.java | 7 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/xml/XmlReader.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/xml/TagWriter.java b/src/main/java/de/pixart/messenger/xml/TagWriter.java index 0a663ce1b..c96841d56 100644 --- a/src/main/java/de/pixart/messenger/xml/TagWriter.java +++ b/src/main/java/de/pixart/messenger/xml/TagWriter.java @@ -99,6 +99,13 @@ public class TagWriter { public void forceClose() { finish(); + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + //ignoring + } + } outputStream = null; } } diff --git a/src/main/java/de/pixart/messenger/xml/XmlReader.java b/src/main/java/de/pixart/messenger/xml/XmlReader.java index 3c8cfa1f2..efd4dcc95 100644 --- a/src/main/java/de/pixart/messenger/xml/XmlReader.java +++ b/src/main/java/de/pixart/messenger/xml/XmlReader.java @@ -82,7 +82,7 @@ public class XmlReader { } } catch (Throwable throwable) { - throw new IOException("xml parser mishandled " + throwable.getClass().getName(), throwable); + throw new IOException("xml parser mishandled " + throwable.getClass().getSimpleName() + "(" + throwable.getMessage() + ")", throwable); } finally { if (wakeLock.isHeld()) { try { diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 883df52d8..7a8e3cfe2 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -1386,6 +1386,9 @@ public class XmppConnection implements Runnable { } private void forceCloseSocket() { + if (tagWriter != null) { + tagWriter.forceClose(); + } if (socket != null) { try { socket.close(); @@ -1405,7 +1408,6 @@ public class XmppConnection implements Runnable { interrupt(); Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": disconnecting force=" + Boolean.valueOf(force)); if (force) { - tagWriter.forceClose(); forceCloseSocket(); } else { if (tagWriter.isActive()) { |