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:
Joakim Erdfelt 2013-01-31 12:29:43 -07:00
parent 242f7f0f45
commit 261809380a
9 changed files with 50 additions and 4 deletions

View File

@ -218,6 +218,11 @@ public class ExtensionStack extends ContainerLifeCycle implements IncomingFrames
for (ExtensionConfig config : configs)
{
Extension ext = factory.newInstance(config);
if (ext == null)
{
// Extension not present on this side
continue;
}
extensions.add(ext);
LOG.debug("Adding Extension: {}",ext);
}

View File

@ -43,8 +43,10 @@ public class WebSocketExtensionFactory extends ExtensionFactory
register("identity",IdentityExtension.class);
register("fragment",FragmentExtension.class);
register("x-webkit-deflate-frame",FrameCompressionExtension.class);
register("permessage-compress",MessageCompressionExtension.class);
/* FIXME: Disabled due to bug report - http://bugs.eclipse.org/395444
* register("x-webkit-deflate-frame",FrameCompressionExtension.class);
* register("permessage-compress",MessageCompressionExtension.class);
*/
}
@Override

View File

@ -29,8 +29,10 @@ import org.eclipse.jetty.websocket.server.helper.IncomingFramesCapture;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
@Ignore("Bug 395444")
public class ChromeTest
{
private static SimpleServletServer server;

View File

@ -29,6 +29,7 @@ import org.eclipse.jetty.websocket.server.helper.IncomingFramesCapture;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
public class FrameCompressionExtensionTest
@ -49,6 +50,7 @@ public class FrameCompressionExtensionTest
}
@Test
@Ignore("Bug 395444")
public void testDeflateFrameExtension() throws Exception
{
BlockheadClient client = new BlockheadClient(server.getServerUri());

View File

@ -22,6 +22,7 @@ import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Locale;
import java.util.Random;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log;
@ -92,6 +93,29 @@ public class BrowserSocket
}
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":
{
Calendar now = Calendar.getInstance();
@ -107,7 +131,7 @@ public class BrowserSocket
}
else
{
// echo it
// Not parameterized, echo it back
writeMessage(message);
}
}

View File

@ -18,6 +18,8 @@
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.WebSocketServletFactory;
@ -30,6 +32,11 @@ public class EchoServlet extends WebSocketServlet
@Override
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);
}
}

View File

@ -12,6 +12,7 @@
<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="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="there" class="button" type="submit" name="there" value="there" disabled="disabled"/>
</div>
@ -20,6 +21,7 @@
$("close").onclick = function(event) {wstool.close(); return false; }
$("info").onclick = function(event) {wstool.write("info:"); 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; }
$("there").onclick = function(event) {wstool.write("There"); return false; }
</script>

View File

@ -69,6 +69,7 @@ var wstool = {
$('close').disabled = !enabled;
$('info').disabled = !enabled;
$('time').disabled = !enabled;
$('many').disabled = !enabled;
$('hello').disabled = !enabled;
$('there').disabled = !enabled;
},

View File

@ -13,7 +13,8 @@ org.eclipse.jetty.LEVEL=WARN
# org.eclipse.jetty.websocket.server.helper.LEVEL=DEBUG
### 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
org.eclipse.jetty.websocket.server.helper.RFCSocket.LEVEL=OFF