Commit 4e2a0280 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fix that avoids an annoying warning when a client's connection sent an end of stream element.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@729 b35dd754-fafc-0310-a699-88a17e54d16e
parent c1567318
...@@ -175,10 +175,13 @@ public class SocketReadThread extends Thread { ...@@ -175,10 +175,13 @@ public class SocketReadThread extends Thread {
*/ */
private void readStream() throws Exception { private void readStream() throws Exception {
while (true) { while (true) {
Document document = reader.parseDocument(); Element doc = reader.parseDocument().getRootElement();
if (document != null) { if (doc == null) {
Element doc = document.getRootElement(); // Stop reading the stream since the client has sent an end of stream element and
// probably closed the connection
return;
}
String tag = doc.getName(); String tag = doc.getName();
if ("message".equals(tag)) { if ("message".equals(tag)) {
...@@ -209,7 +212,6 @@ public class SocketReadThread extends Thread { ...@@ -209,7 +212,6 @@ public class SocketReadThread extends Thread {
} }
} }
} }
}
private IQ getIQ(Element doc) { private IQ getIQ(Element doc) {
Element query = doc.element("query"); Element query = doc.element("query");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment