Commit cdcd1251 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Send end of stream before tagging session as closed. JM-1154

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9348 b35dd754-fafc-0310-a699-88a17e54d16e
parent d3c4c137
......@@ -33,8 +33,8 @@ import org.xmpp.packet.Packet;
import javax.net.ssl.KeyManager;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.nio.charset.Charset;
......@@ -147,14 +147,14 @@ public class NIOConnection implements Connection {
boolean closedSuccessfully = false;
synchronized (this) {
if (!isClosed()) {
if (session != null) {
session.setStatus(Session.STATUS_CLOSED);
}
try {
deliverRawText(flashClient ? "</flash:stream>" : "</stream:stream>", false);
} catch (Exception e) {
// Ignore
}
if (session != null) {
session.setStatus(Session.STATUS_CLOSED);
}
ioSession.close();
closed = true;
closedSuccessfully = true;
......@@ -271,7 +271,8 @@ public class NIOConnection implements Connection {
Log.debug("Error delivering raw text" + "\n" + this.toString(), e);
errorDelivering = true;
}
if (errorDelivering) {
// Close the connection if delivering text fails and we are already not closing the connection
if (errorDelivering && asynchronous) {
close();
}
}
......
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