jetty-9 fixed after merged
This commit is contained in:
parent
72bfacd5a4
commit
726898ffd8
|
@ -28,7 +28,7 @@ import java.util.concurrent.Executors;
|
|||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.util.component.AggregateLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
@ -49,7 +49,7 @@ public class WebSocketClientFactory extends AggregateLifeCycle
|
|||
{
|
||||
private static final Logger LOG = Log.getLogger(WebSocketClientFactory.class);
|
||||
|
||||
private final ByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
private final Executor executor;
|
||||
private final ScheduledExecutorService scheduler;
|
||||
private final EventMethodsCache methodsCache;
|
||||
|
|
|
@ -43,7 +43,7 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.IO;
|
||||
|
@ -95,7 +95,7 @@ public class BlockheadServer
|
|||
this.socket = socket;
|
||||
this.incomingFrames = new IncomingFramesCapture();
|
||||
this.policy = WebSocketPolicy.newServerPolicy();
|
||||
this.bufferPool = new StandardByteBufferPool(policy.getBufferSize());
|
||||
this.bufferPool = new MappedByteBufferPool(policy.getBufferSize());
|
||||
this.parser = new Parser(policy);
|
||||
this.parseCount = new AtomicInteger(0);
|
||||
this.generator = new Generator(policy,bufferPool,false);
|
||||
|
|
|
@ -22,7 +22,7 @@ import static org.hamcrest.Matchers.is;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
|
||||
import org.eclipse.jetty.websocket.masks.FixedMasker;
|
||||
|
@ -41,7 +41,7 @@ public class GeneratorParserRoundtripTest
|
|||
public void testParserAndGenerator() throws Exception
|
||||
{
|
||||
WebSocketPolicy policy = WebSocketPolicy.newServerPolicy();
|
||||
StandardByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
MappedByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
Generator gen = new Generator(policy,bufferPool);
|
||||
Parser parser = new Parser(policy);
|
||||
IncomingFramesCapture capture = new IncomingFramesCapture();
|
||||
|
@ -79,7 +79,7 @@ public class GeneratorParserRoundtripTest
|
|||
WebSocketPolicy policy = WebSocketPolicy.newServerPolicy();
|
||||
policy.setMasker(new RandomMasker());
|
||||
|
||||
StandardByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
MappedByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
Generator gen = new Generator(policy,bufferPool);
|
||||
Parser parser = new Parser(policy);
|
||||
IncomingFramesCapture capture = new IncomingFramesCapture();
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
package org.eclipse.jetty.websocket.driver;
|
||||
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.websocket.api.StatusCode;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
|
||||
import org.eclipse.jetty.websocket.examples.AdapterConnectCloseSocket;
|
||||
|
@ -50,7 +50,7 @@ public class WebSocketEventDriverTest
|
|||
EventMethodsCache methodsCache = new EventMethodsCache();
|
||||
methodsCache.register(websocket.getClass());
|
||||
WebSocketPolicy policy = WebSocketPolicy.newServerPolicy();
|
||||
ByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
ByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
return new WebSocketEventDriver(websocket,methodsCache,policy,bufferPool);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.ArrayList;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.FutureCallback;
|
||||
|
@ -73,7 +73,7 @@ public class DeflateFrameExtensionTest
|
|||
policy.setMaxPayloadSize(150000);
|
||||
|
||||
DeflateFrameExtension ext = new DeflateFrameExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(policy);
|
||||
|
||||
ExtensionConfig config = ExtensionConfig.parse("x-deflate-frame;minLength=8");
|
||||
|
@ -111,7 +111,7 @@ public class DeflateFrameExtensionTest
|
|||
Assert.assertThat("Medium Payload Length",msg.length(),allOf(greaterThanOrEqualTo(0x7E),lessThanOrEqualTo(0xFF_FF)));
|
||||
|
||||
DeflateFrameExtension ext = new DeflateFrameExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("x-deflate-frame;minLength=8");
|
||||
ext.setConfig(config);
|
||||
|
@ -134,7 +134,7 @@ public class DeflateFrameExtensionTest
|
|||
public void testFlateSmall()
|
||||
{
|
||||
DeflateFrameExtension ext = new DeflateFrameExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("x-deflate-frame;minLength=8");
|
||||
ext.setConfig(config);
|
||||
|
@ -169,7 +169,7 @@ public class DeflateFrameExtensionTest
|
|||
public void testFlateSmall_Many()
|
||||
{
|
||||
DeflateFrameExtension ext = new DeflateFrameExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("x-deflate-frame;minLength=8");
|
||||
ext.setConfig(config);
|
||||
|
@ -204,7 +204,7 @@ public class DeflateFrameExtensionTest
|
|||
IncomingFramesCapture capture = new IncomingFramesCapture();
|
||||
|
||||
DeflateFrameExtension ext = new DeflateFrameExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("x-deflate-frame;minLength=16");
|
||||
ext.setConfig(config);
|
||||
|
@ -258,7 +258,7 @@ public class DeflateFrameExtensionTest
|
|||
IncomingFramesCapture capture = new IncomingFramesCapture();
|
||||
|
||||
DeflateFrameExtension ext = new DeflateFrameExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("x-deflate-frame;minLength=16");
|
||||
ext.setConfig(config);
|
||||
|
@ -293,7 +293,7 @@ public class DeflateFrameExtensionTest
|
|||
IncomingFramesCapture capture = new IncomingFramesCapture();
|
||||
|
||||
DeflateFrameExtension ext = new DeflateFrameExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("x-deflate-frame;minLength=16");
|
||||
ext.setConfig(config);
|
||||
|
@ -347,7 +347,7 @@ public class DeflateFrameExtensionTest
|
|||
OutgoingFramesCapture capture = new OutgoingFramesCapture();
|
||||
|
||||
DeflateFrameExtension ext = new DeflateFrameExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("x-deflate-frame;minLength=16");
|
||||
ext.setConfig(config);
|
||||
|
@ -413,7 +413,7 @@ public class DeflateFrameExtensionTest
|
|||
OutgoingFramesCapture capture = new OutgoingFramesCapture();
|
||||
|
||||
DeflateFrameExtension ext = new DeflateFrameExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("x-deflate-frame;minLength=16");
|
||||
ext.setConfig(config);
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.ArrayList;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.FutureCallback;
|
||||
|
@ -78,7 +78,7 @@ public class FragmentExtensionTest
|
|||
IncomingFramesCapture capture = new IncomingFramesCapture();
|
||||
|
||||
FragmentExtension ext = new FragmentExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("fragment;maxLength=4");
|
||||
ext.setConfig(config);
|
||||
|
@ -130,7 +130,7 @@ public class FragmentExtensionTest
|
|||
IncomingFramesCapture capture = new IncomingFramesCapture();
|
||||
|
||||
FragmentExtension ext = new FragmentExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("fragment;maxLength=4");
|
||||
ext.setConfig(config);
|
||||
|
@ -165,7 +165,7 @@ public class FragmentExtensionTest
|
|||
OutgoingFramesCapture capture = new OutgoingFramesCapture();
|
||||
|
||||
FragmentExtension ext = new FragmentExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("fragment;maxLength=20");
|
||||
ext.setConfig(config);
|
||||
|
@ -247,7 +247,7 @@ public class FragmentExtensionTest
|
|||
OutgoingFramesCapture capture = new OutgoingFramesCapture();
|
||||
|
||||
FragmentExtension ext = new FragmentExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("fragment");
|
||||
ext.setConfig(config);
|
||||
|
@ -324,7 +324,7 @@ public class FragmentExtensionTest
|
|||
OutgoingFramesCapture capture = new OutgoingFramesCapture();
|
||||
|
||||
FragmentExtension ext = new FragmentExtension();
|
||||
ext.setBufferPool(new StandardByteBufferPool());
|
||||
ext.setBufferPool(new MappedByteBufferPool());
|
||||
ext.setPolicy(WebSocketPolicy.newServerPolicy());
|
||||
ExtensionConfig config = ExtensionConfig.parse("fragment;maxLength=4");
|
||||
ext.setConfig(config);
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.eclipse.jetty.websocket.protocol;
|
|||
import java.nio.ByteBuffer;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
|
||||
|
||||
|
@ -63,6 +63,6 @@ public class UnitGenerator extends Generator
|
|||
|
||||
public UnitGenerator()
|
||||
{
|
||||
super(WebSocketPolicy.newServerPolicy(),new StandardByteBufferPool());
|
||||
super(WebSocketPolicy.newServerPolicy(),new MappedByteBufferPool());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.eclipse.jetty.websocket.protocol;
|
|||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.websocket.ByteBufferAssert;
|
||||
import org.eclipse.jetty.websocket.api.StatusCode;
|
||||
|
@ -38,7 +38,7 @@ public class WebSocketFrameTest
|
|||
public static void initGenerator()
|
||||
{
|
||||
WebSocketPolicy policy = WebSocketPolicy.newServerPolicy();
|
||||
ByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
ByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
strictGenerator = new Generator(policy,bufferPool);
|
||||
laxGenerator = new Generator(policy,bufferPool,false);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.server.HttpConnection;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
@ -86,7 +86,7 @@ public class WebSocketServerFactory extends AbstractLifeCycle implements WebSock
|
|||
|
||||
public WebSocketServerFactory(WebSocketPolicy policy)
|
||||
{
|
||||
this(policy,new StandardByteBufferPool());
|
||||
this(policy,new MappedByteBufferPool());
|
||||
}
|
||||
|
||||
public WebSocketServerFactory(WebSocketPolicy policy, ByteBufferPool bufferPool)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
package org.eclipse.jetty.websocket.server;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
|
||||
import org.eclipse.jetty.websocket.protocol.Generator;
|
||||
|
||||
|
@ -29,6 +29,6 @@ public class UnitGenerator extends Generator
|
|||
{
|
||||
public UnitGenerator()
|
||||
{
|
||||
super(WebSocketPolicy.newServerPolicy(),new StandardByteBufferPool());
|
||||
super(WebSocketPolicy.newServerPolicy(),new MappedByteBufferPool());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.eclipse.jetty.websocket.server.ab;
|
|||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
|
||||
import org.eclipse.jetty.websocket.protocol.Generator;
|
||||
|
@ -47,7 +47,7 @@ public abstract class AbstractABCase
|
|||
public static void initGenerators()
|
||||
{
|
||||
WebSocketPolicy policy = WebSocketPolicy.newClientPolicy();
|
||||
ByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
ByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
strictGenerator = new Generator(policy,bufferPool,true);
|
||||
laxGenerator = new Generator(policy,bufferPool,false);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ import java.util.regex.Pattern;
|
|||
import javax.net.ssl.HttpsURLConnection;
|
||||
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.IO;
|
||||
|
@ -128,7 +128,7 @@ public class BlockheadClient implements IncomingFrames, OutgoingFrames
|
|||
this.destHttpURI = new URI(scheme,destWebsocketURI.getSchemeSpecificPart(),destWebsocketURI.getFragment());
|
||||
|
||||
this.policy = policy;
|
||||
this.bufferPool = new StandardByteBufferPool(policy.getBufferSize());
|
||||
this.bufferPool = new MappedByteBufferPool(policy.getBufferSize());
|
||||
this.generator = new Generator(policy,bufferPool);
|
||||
this.parser = new Parser(policy);
|
||||
this.parseCount = new AtomicInteger(0);
|
||||
|
|
Loading…
Reference in New Issue