Commit 3e10288f authored by Hal Deadman's avatar Hal Deadman Committed by daryl herzmann

fix EXTERNAL auth stackoverflow error

parent 96108d07
...@@ -47,6 +47,8 @@ import org.jivesoftware.openfire.net.SASLAuthentication; ...@@ -47,6 +47,8 @@ import org.jivesoftware.openfire.net.SASLAuthentication;
import org.jivesoftware.openfire.net.VirtualConnection; import org.jivesoftware.openfire.net.VirtualConnection;
import org.jivesoftware.openfire.session.LocalClientSession; import org.jivesoftware.openfire.session.LocalClientSession;
import org.jivesoftware.openfire.spi.ConnectionConfiguration; import org.jivesoftware.openfire.spi.ConnectionConfiguration;
import org.jivesoftware.openfire.spi.ConnectionManagerImpl;
import org.jivesoftware.openfire.spi.ConnectionType;
import org.jivesoftware.util.JiveConstants; import org.jivesoftware.util.JiveConstants;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.TaskEngine; import org.jivesoftware.util.TaskEngine;
...@@ -134,7 +136,7 @@ public class HttpSession extends LocalClientSession { ...@@ -134,7 +136,7 @@ public class HttpSession extends LocalClientSession {
public HttpSession(PacketDeliverer backupDeliverer, String serverName, InetAddress address, public HttpSession(PacketDeliverer backupDeliverer, String serverName, InetAddress address,
StreamID streamID, long rid, HttpConnection connection, Locale language) { StreamID streamID, long rid, HttpConnection connection, Locale language) {
super(serverName, new HttpVirtualConnection(address), streamID, language); super(serverName, new HttpVirtualConnection(address, ConnectionType.SOCKET_C2S), streamID, language);
this.isClosed = false; this.isClosed = false;
this.lastActivity = System.currentTimeMillis(); this.lastActivity = System.currentTimeMillis();
this.lastRequestID = rid; this.lastRequestID = rid;
...@@ -1101,9 +1103,16 @@ public class HttpSession extends LocalClientSession { ...@@ -1101,9 +1103,16 @@ public class HttpSession extends LocalClientSession {
private InetAddress address; private InetAddress address;
private ConnectionConfiguration configuration; private ConnectionConfiguration configuration;
private ConnectionType connectionType;
public HttpVirtualConnection(InetAddress address) { public HttpVirtualConnection(InetAddress address) {
this.address = address; this.address = address;
this.connectionType = ConnectionType.SOCKET_C2S;
}
public HttpVirtualConnection(InetAddress address, ConnectionType connectionType) {
this.address = address;
this.connectionType = connectionType;
} }
@Override @Override
...@@ -1143,7 +1152,11 @@ public class HttpSession extends LocalClientSession { ...@@ -1143,7 +1152,11 @@ public class HttpSession extends LocalClientSession {
@Override @Override
public ConnectionConfiguration getConfiguration() { public ConnectionConfiguration getConfiguration() {
return session.getConnection().getConfiguration(); if (configuration == null) {
final ConnectionManagerImpl connectionManager = ((ConnectionManagerImpl) XMPPServer.getInstance().getConnectionManager());
configuration = connectionManager.getListener( connectionType, true ).generateConnectionConfiguration();
}
return configuration;
} }
@Override @Override
......
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