Commit 5f3030b2 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Serve Flash policy file from client port. JM-1361

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10388 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8e52f7c1
...@@ -14,7 +14,9 @@ package org.jivesoftware.openfire.net; ...@@ -14,7 +14,9 @@ package org.jivesoftware.openfire.net;
import org.dom4j.Element; import org.dom4j.Element;
import org.dom4j.io.XMPPPacketReader; import org.dom4j.io.XMPPPacketReader;
import org.jivesoftware.openfire.Connection; import org.jivesoftware.openfire.Connection;
import org.jivesoftware.openfire.FlashCrossDomainHandler;
import org.jivesoftware.openfire.PacketRouter; import org.jivesoftware.openfire.PacketRouter;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.auth.UnauthorizedException; import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.session.LocalSession; import org.jivesoftware.openfire.session.LocalSession;
import org.jivesoftware.openfire.session.Session; import org.jivesoftware.openfire.session.Session;
...@@ -90,9 +92,19 @@ public abstract class StanzaHandler { ...@@ -90,9 +92,19 @@ public abstract class StanzaHandler {
boolean initialStream = stanza.startsWith("<stream:stream") || stanza.startsWith("<flash:stream"); boolean initialStream = stanza.startsWith("<stream:stream") || stanza.startsWith("<flash:stream");
if (!sessionCreated || initialStream) { if (!sessionCreated || initialStream) {
if (!initialStream) { if (!initialStream) {
// Allow requests for flash socket policy files directly on the client listener port
if (stanza.startsWith("<policy-file-request/>")) {
String crossDomainText = FlashCrossDomainHandler.CROSS_DOMAIN_TEXT +
XMPPServer.getInstance().getConnectionManager().getClientListenerPort() +
FlashCrossDomainHandler.CROSS_DOMAIN_END_TEXT + '\0';
connection.deliverRawText(crossDomainText);
return;
}
else {
// Ignore <?xml version="1.0"?> // Ignore <?xml version="1.0"?>
return; return;
} }
}
// Found an stream:stream tag... // Found an stream:stream tag...
if (!sessionCreated) { if (!sessionCreated) {
sessionCreated = true; sessionCreated = true;
......
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