395444 - Disabling Websocket Compress Extensions (not working with Chrome / deflate problem)
+ Adding test case example of many server messages in a row + Disabling various compression extensions till a solution is found
This commit is contained in:
parent
242f7f0f45
commit
261809380a
|
@ -218,6 +218,11 @@ public class ExtensionStack extends ContainerLifeCycle implements IncomingFrames
|
||||||
for (ExtensionConfig config : configs)
|
for (ExtensionConfig config : configs)
|
||||||
{
|
{
|
||||||
Extension ext = factory.newInstance(config);
|
Extension ext = factory.newInstance(config);
|
||||||
|
if (ext == null)
|
||||||
|
{
|
||||||
|
// Extension not present on this side
|
||||||
|
continue;
|
||||||
|
}
|
||||||
extensions.add(ext);
|
extensions.add(ext);
|
||||||
LOG.debug("Adding Extension: {}",ext);
|
LOG.debug("Adding Extension: {}",ext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,10 @@ public class WebSocketExtensionFactory extends ExtensionFactory
|
||||||
|
|
||||||
register("identity",IdentityExtension.class);
|
register("identity",IdentityExtension.class);
|
||||||
register("fragment",FragmentExtension.class);
|
register("fragment",FragmentExtension.class);
|
||||||
register("x-webkit-deflate-frame",FrameCompressionExtension.class);
|
/* FIXME: Disabled due to bug report - http://bugs.eclipse.org/395444
|
||||||
register("permessage-compress",MessageCompressionExtension.class);
|
* register("x-webkit-deflate-frame",FrameCompressionExtension.class);
|
||||||
|
* register("permessage-compress",MessageCompressionExtension.class);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,8 +29,10 @@ import org.eclipse.jetty.websocket.server.helper.IncomingFramesCapture;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
@Ignore("Bug 395444")
|
||||||
public class ChromeTest
|
public class ChromeTest
|
||||||
{
|
{
|
||||||
private static SimpleServletServer server;
|
private static SimpleServletServer server;
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.eclipse.jetty.websocket.server.helper.IncomingFramesCapture;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class FrameCompressionExtensionTest
|
public class FrameCompressionExtensionTest
|
||||||
|
@ -49,6 +50,7 @@ public class FrameCompressionExtensionTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore("Bug 395444")
|
||||||
public void testDeflateFrameExtension() throws Exception
|
public void testDeflateFrameExtension() throws Exception
|
||||||
{
|
{
|
||||||
BlockheadClient client = new BlockheadClient(server.getServerUri());
|
BlockheadClient client = new BlockheadClient(server.getServerUri());
|
||||||
|
|
|
@ -22,6 +22,7 @@ import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import org.eclipse.jetty.util.StringUtil;
|
import org.eclipse.jetty.util.StringUtil;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
|
@ -92,6 +93,29 @@ public class BrowserSocket
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case "many":
|
||||||
|
{
|
||||||
|
String parts[] = val.split(",");
|
||||||
|
int size = Integer.parseInt(parts[0]);
|
||||||
|
int count = Integer.parseInt(parts[1]);
|
||||||
|
|
||||||
|
char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-|{}[]():".toCharArray();
|
||||||
|
int lettersLen = letters.length;
|
||||||
|
char randomText[] = new char[size];
|
||||||
|
Random rand = new Random();
|
||||||
|
|
||||||
|
for (int n = 0; n < count; n++)
|
||||||
|
{
|
||||||
|
// create random text
|
||||||
|
for (int i = 0; i < size; i++)
|
||||||
|
{
|
||||||
|
randomText[i] = letters[rand.nextInt(lettersLen)];
|
||||||
|
}
|
||||||
|
writeMessage("Many [%s]",String.valueOf(randomText));
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case "time":
|
case "time":
|
||||||
{
|
{
|
||||||
Calendar now = Calendar.getInstance();
|
Calendar now = Calendar.getInstance();
|
||||||
|
@ -107,7 +131,7 @@ public class BrowserSocket
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// echo it
|
// Not parameterized, echo it back
|
||||||
writeMessage(message);
|
writeMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.websocket.server.helper;
|
package org.eclipse.jetty.websocket.server.helper;
|
||||||
|
|
||||||
|
import org.eclipse.jetty.websocket.common.extensions.compress.FrameCompressionExtension;
|
||||||
|
import org.eclipse.jetty.websocket.common.extensions.compress.MessageCompressionExtension;
|
||||||
import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
|
import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
|
||||||
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
|
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
|
||||||
|
|
||||||
|
@ -30,6 +32,11 @@ public class EchoServlet extends WebSocketServlet
|
||||||
@Override
|
@Override
|
||||||
public void configure(WebSocketServletFactory factory)
|
public void configure(WebSocketServletFactory factory)
|
||||||
{
|
{
|
||||||
|
// Setup some extensions we want to test against
|
||||||
|
factory.getExtensionFactory().register("x-webkit-deflate-frame",FrameCompressionExtension.class);
|
||||||
|
factory.getExtensionFactory().register("permessage-compress",MessageCompressionExtension.class);
|
||||||
|
|
||||||
|
// Setup the desired Socket to use for all incoming upgrade requests
|
||||||
factory.register(EchoSocket.class);
|
factory.register(EchoSocket.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<input id="close" class="button" type="submit" name="close" value="close" disabled="disabled"/>
|
<input id="close" class="button" type="submit" name="close" value="close" disabled="disabled"/>
|
||||||
<input id="info" class="button" type="submit" name="info" value="info" disabled="disabled"/>
|
<input id="info" class="button" type="submit" name="info" value="info" disabled="disabled"/>
|
||||||
<input id="time" class="button" type="submit" name="time" value="time" disabled="disabled"/>
|
<input id="time" class="button" type="submit" name="time" value="time" disabled="disabled"/>
|
||||||
|
<input id="many" class="button" type="submit" name="many" value="many" disabled="disabled"/>
|
||||||
<input id="hello" class="button" type="submit" name="hello" value="hello" disabled="disabled"/>
|
<input id="hello" class="button" type="submit" name="hello" value="hello" disabled="disabled"/>
|
||||||
<input id="there" class="button" type="submit" name="there" value="there" disabled="disabled"/>
|
<input id="there" class="button" type="submit" name="there" value="there" disabled="disabled"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
$("close").onclick = function(event) {wstool.close(); return false; }
|
$("close").onclick = function(event) {wstool.close(); return false; }
|
||||||
$("info").onclick = function(event) {wstool.write("info:"); return false; }
|
$("info").onclick = function(event) {wstool.write("info:"); return false; }
|
||||||
$("time").onclick = function(event) {wstool.write("time:"); return false; }
|
$("time").onclick = function(event) {wstool.write("time:"); return false; }
|
||||||
|
$("many").onclick = function(event) {wstool.write("many:15,30"); return false; }
|
||||||
$("hello").onclick = function(event) {wstool.write("Hello"); return false; }
|
$("hello").onclick = function(event) {wstool.write("Hello"); return false; }
|
||||||
$("there").onclick = function(event) {wstool.write("There"); return false; }
|
$("there").onclick = function(event) {wstool.write("There"); return false; }
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -69,6 +69,7 @@ var wstool = {
|
||||||
$('close').disabled = !enabled;
|
$('close').disabled = !enabled;
|
||||||
$('info').disabled = !enabled;
|
$('info').disabled = !enabled;
|
||||||
$('time').disabled = !enabled;
|
$('time').disabled = !enabled;
|
||||||
|
$('many').disabled = !enabled;
|
||||||
$('hello').disabled = !enabled;
|
$('hello').disabled = !enabled;
|
||||||
$('there').disabled = !enabled;
|
$('there').disabled = !enabled;
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,7 +13,8 @@ org.eclipse.jetty.LEVEL=WARN
|
||||||
# org.eclipse.jetty.websocket.server.helper.LEVEL=DEBUG
|
# org.eclipse.jetty.websocket.server.helper.LEVEL=DEBUG
|
||||||
|
|
||||||
### Show state changes on BrowserDebugTool
|
### Show state changes on BrowserDebugTool
|
||||||
# org.eclipse.jetty.websocket.server.browser.LEVEL=DEBUG
|
# -- LEAVE THIS AT DEBUG LEVEL --
|
||||||
|
org.eclipse.jetty.websocket.server.browser.LEVEL=DEBUG
|
||||||
|
|
||||||
### Disabling intentional error out of RFCSocket
|
### Disabling intentional error out of RFCSocket
|
||||||
org.eclipse.jetty.websocket.server.helper.RFCSocket.LEVEL=OFF
|
org.eclipse.jetty.websocket.server.helper.RFCSocket.LEVEL=OFF
|
||||||
|
|
Loading…
Reference in New Issue