Fixed compilation errors after merging branch 'jetty-9-aggregation' into jetty-9-spdy-http
This commit is contained in:
parent
06b2de17d5
commit
171ad66962
|
@ -26,7 +26,7 @@ import java.util.concurrent.ScheduledExecutorService;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
import org.eclipse.jetty.spdy.api.SPDYException;
|
||||
import org.eclipse.jetty.spdy.api.Session;
|
||||
|
@ -46,10 +46,10 @@ public class AsyncTimeoutTest
|
|||
final long timeout = 1000;
|
||||
final TimeUnit unit = TimeUnit.MILLISECONDS;
|
||||
|
||||
ByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
ByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
Executor threadPool = Executors.newCachedThreadPool();
|
||||
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
Generator generator = new Generator(bufferPool, new StandardCompressionFactory.StandardCompressor());
|
||||
Session session = new StandardSession(SPDY.V2, bufferPool, threadPool, scheduler, new TestController(), null, 1, null, generator, new FlowControlStrategy.None())
|
||||
{
|
||||
@Override
|
||||
|
@ -91,10 +91,10 @@ public class AsyncTimeoutTest
|
|||
final long timeout = 1000;
|
||||
final TimeUnit unit = TimeUnit.MILLISECONDS;
|
||||
|
||||
ByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
ByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
Executor threadPool = Executors.newCachedThreadPool();
|
||||
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
Generator generator = new Generator(bufferPool, new StandardCompressionFactory.StandardCompressor());
|
||||
Session session = new StandardSession(SPDY.V2, bufferPool, threadPool, scheduler, new TestController(), null, 1, null, generator, new FlowControlStrategy.None())
|
||||
{
|
||||
@Override
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardSession.FrameBytes;
|
||||
import org.eclipse.jetty.spdy.api.ByteBufferDataInfo;
|
||||
import org.eclipse.jetty.spdy.api.DataInfo;
|
||||
|
@ -82,10 +82,10 @@ public class StandardSessionTest
|
|||
@Before
|
||||
public void setUp() throws Exception
|
||||
{
|
||||
bufferPool = new StandardByteBufferPool();
|
||||
bufferPool = new MappedByteBufferPool();
|
||||
threadPool = Executors.newCachedThreadPool();
|
||||
scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||
generator = new Generator(new StandardByteBufferPool(),new StandardCompressionFactory.StandardCompressor());
|
||||
generator = new Generator(bufferPool, new StandardCompressionFactory.StandardCompressor());
|
||||
session = new StandardSession(SPDY.V2,bufferPool,threadPool,scheduler,controller,null,1,null,generator,new FlowControlStrategy.None());
|
||||
headers = new Headers();
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.nio.ByteBuffer;
|
|||
import java.security.KeyStore;
|
||||
import java.security.cert.Certificate;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
import org.eclipse.jetty.spdy.generator.Generator;
|
||||
|
@ -44,7 +44,7 @@ public class CredentialGenerateParseTest
|
|||
System.arraycopy(temp, 0, certificates, 0, temp.length);
|
||||
System.arraycopy(temp, 0, certificates, temp.length, temp.length);
|
||||
CredentialFrame frame1 = new CredentialFrame(SPDY.V3, slot, proof, certificates);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -72,7 +72,7 @@ public class CredentialGenerateParseTest
|
|||
byte[] proof = new byte[]{0, 1, 2};
|
||||
Certificate[] certificates = loadCertificates();
|
||||
CredentialFrame frame1 = new CredentialFrame(SPDY.V3, slot, proof, certificates);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.DataInfo;
|
||||
import org.eclipse.jetty.spdy.api.StringDataInfo;
|
||||
|
@ -48,7 +48,7 @@ public class DataGenerateParseTest
|
|||
int length = content.length();
|
||||
DataInfo data = new StringDataInfo(content, true);
|
||||
int streamId = 13;
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.data(streamId, 2 * length, data);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -73,7 +73,7 @@ public class DataGenerateParseTest
|
|||
int length = content.length();
|
||||
DataInfo data = new StringDataInfo(content, true);
|
||||
int streamId = 13;
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.data(streamId, 2 * length, data);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -103,7 +103,7 @@ public class DataGenerateParseTest
|
|||
int length = content.length();
|
||||
DataInfo data = new StringDataInfo(content, true);
|
||||
int streamId = 13;
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.data(streamId, 2 * length, data);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
import org.eclipse.jetty.spdy.generator.Generator;
|
||||
|
@ -36,7 +36,7 @@ public class GoAwayGenerateParseTest
|
|||
int lastStreamId = 13;
|
||||
int statusCode = 1;
|
||||
GoAwayFrame frame1 = new GoAwayFrame(SPDY.V3, lastStreamId, statusCode);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -62,7 +62,7 @@ public class GoAwayGenerateParseTest
|
|||
int lastStreamId = 13;
|
||||
int statusCode = 1;
|
||||
GoAwayFrame frame1 = new GoAwayFrame(SPDY.V3, lastStreamId, statusCode);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.Headers;
|
||||
import org.eclipse.jetty.spdy.api.HeadersInfo;
|
||||
|
@ -55,7 +55,7 @@ public class HeadersGenerateParseTest
|
|||
private ByteBuffer createHeadersFrameBuffer(Headers headers)
|
||||
{
|
||||
HeadersFrame frame1 = new HeadersFrame(SPDY.V2, flags, streamId, headers);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
assertThat("Buffer is not null", buffer, notNullValue());
|
||||
return buffer;
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.generator.Generator;
|
||||
import org.eclipse.jetty.spdy.parser.Parser;
|
||||
|
@ -33,7 +33,7 @@ public class NoOpGenerateParseTest
|
|||
public void testGenerateParse() throws Exception
|
||||
{
|
||||
NoOpFrame frame1 = new NoOpFrame();
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -54,7 +54,7 @@ public class NoOpGenerateParseTest
|
|||
public void testGenerateParseOneByteAtATime() throws Exception
|
||||
{
|
||||
NoOpFrame frame1 = new NoOpFrame();
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
import org.eclipse.jetty.spdy.generator.Generator;
|
||||
|
@ -35,7 +35,7 @@ public class PingGenerateParseTest
|
|||
{
|
||||
int pingId = 13;
|
||||
PingFrame frame1 = new PingFrame(SPDY.V2, pingId);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -59,7 +59,7 @@ public class PingGenerateParseTest
|
|||
{
|
||||
int pingId = 13;
|
||||
PingFrame frame1 = new PingFrame(SPDY.V2, pingId);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
import org.eclipse.jetty.spdy.api.StreamStatus;
|
||||
|
@ -43,7 +43,7 @@ public class RstStreamGenerateParseTest
|
|||
int streamId = 13;
|
||||
int streamStatus = StreamStatus.UNSUPPORTED_VERSION.getCode(SPDY.V2);
|
||||
RstStreamFrame frame1 = new RstStreamFrame(SPDY.V2, streamId, streamStatus);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
assertThat("buffer is not null", buffer, not(nullValue()));
|
||||
|
@ -69,7 +69,7 @@ public class RstStreamGenerateParseTest
|
|||
int streamId = 13;
|
||||
int streamStatus = StreamStatus.UNSUPPORTED_VERSION.getCode(SPDY.V2);
|
||||
RstStreamFrame frame1 = new RstStreamFrame(SPDY.V2, streamId, streamStatus);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
import org.eclipse.jetty.spdy.api.Settings;
|
||||
|
@ -40,7 +40,7 @@ public class SettingsGenerateParseTest
|
|||
settings.put(new Settings.Setting(Settings.ID.MAX_CONCURRENT_STREAMS, Settings.Flag.PERSIST, 100));
|
||||
settings.put(new Settings.Setting(Settings.ID.ROUND_TRIP_TIME, Settings.Flag.PERSISTED, 500));
|
||||
SettingsFrame frame1 = new SettingsFrame(SPDY.V2, flags, settings);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -67,7 +67,7 @@ public class SettingsGenerateParseTest
|
|||
settings.put(new Settings.Setting(Settings.ID.DOWNLOAD_RETRANSMISSION_RATE, 100));
|
||||
settings.put(new Settings.Setting(Settings.ID.ROUND_TRIP_TIME, 500));
|
||||
SettingsFrame frame1 = new SettingsFrame(SPDY.V2, flags, settings);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.Headers;
|
||||
import org.eclipse.jetty.spdy.api.ReplyInfo;
|
||||
|
@ -40,7 +40,7 @@ public class SynReplyGenerateParseTest
|
|||
Headers headers = new Headers();
|
||||
headers.put("a", "b");
|
||||
SynReplyFrame frame1 = new SynReplyFrame(SPDY.V2, flags, streamId, headers);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -68,7 +68,7 @@ public class SynReplyGenerateParseTest
|
|||
Headers headers = new Headers();
|
||||
headers.put("a", "b");
|
||||
SynReplyFrame frame1 = new SynReplyFrame(SPDY.V2, flags, streamId, headers);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.Headers;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
|
@ -44,7 +44,7 @@ public class SynStreamGenerateParseTest
|
|||
headers.put("a", "b");
|
||||
headers.put("c", "d");
|
||||
SynStreamFrame frame1 = new SynStreamFrame(SPDY.V2, flags, streamId, associatedStreamId, priority, slot, headers);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -79,7 +79,7 @@ public class SynStreamGenerateParseTest
|
|||
headers.put("a", "b");
|
||||
headers.put("c", "d");
|
||||
SynStreamFrame frame1 = new SynStreamFrame(SPDY.V2, flags, streamId, associatedStreamId, priority, slot, headers);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.spdy.frames;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
import org.eclipse.jetty.spdy.generator.Generator;
|
||||
|
@ -36,7 +36,7 @@ public class WindowUpdateGenerateParseTest
|
|||
int streamId = 13;
|
||||
int windowDelta = 17;
|
||||
WindowUpdateFrame frame1 = new WindowUpdateFrame(SPDY.V2, streamId, windowDelta);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
@ -62,7 +62,7 @@ public class WindowUpdateGenerateParseTest
|
|||
int streamId = 13;
|
||||
int windowDelta = 17;
|
||||
WindowUpdateFrame frame1 = new WindowUpdateFrame(SPDY.V2, streamId, windowDelta);
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
ByteBuffer buffer = generator.control(frame1);
|
||||
|
||||
Assert.assertNotNull(buffer);
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.nio.ByteBuffer;
|
|||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.SessionException;
|
||||
import org.eclipse.jetty.spdy.StandardCompressionFactory;
|
||||
import org.eclipse.jetty.spdy.StreamException;
|
||||
|
@ -42,7 +42,7 @@ public class UnknownControlFrameTest
|
|||
public void testUnknownControlFrame() throws Exception
|
||||
{
|
||||
SynStreamFrame frame = new SynStreamFrame(SPDY.V2, SynInfo.FLAG_CLOSE, 1, 0, (byte)0, (short)0, new Headers());
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
ByteBuffer buffer = generator.control(frame);
|
||||
// Change the frame type to unknown
|
||||
buffer.putShort(2, (short)0);
|
||||
|
|
|
@ -60,12 +60,6 @@
|
|||
<version>1.0.0.v20120402</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
|
|
|
@ -35,15 +35,13 @@ import org.eclipse.jetty.http.HttpHeader;
|
|||
import org.eclipse.jetty.http.HttpMethod;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.Connection;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.server.Connector;
|
||||
import org.eclipse.jetty.server.HttpChannel;
|
||||
import org.eclipse.jetty.server.HttpConfiguration;
|
||||
import org.eclipse.jetty.server.HttpInput;
|
||||
import org.eclipse.jetty.server.Response;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.spdy.ServerSPDYAsyncConnectionFactory;
|
||||
import org.eclipse.jetty.spdy.ServerSPDYConnectionFactory;
|
||||
import org.eclipse.jetty.spdy.api.ByteBufferDataInfo;
|
||||
import org.eclipse.jetty.spdy.api.DataInfo;
|
||||
import org.eclipse.jetty.spdy.api.Headers;
|
||||
|
@ -57,7 +55,7 @@ import org.eclipse.jetty.spdy.api.server.ServerSessionFrameListener;
|
|||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnectionFactory
|
||||
public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYConnectionFactory
|
||||
{
|
||||
private static final String CHANNEL_ATTRIBUTE = "org.eclipse.jetty.spdy.http.HTTPChannelOverSPDY";
|
||||
private static final Logger logger = Log.getLogger(ServerHTTPSPDYAsyncConnectionFactory.class);
|
||||
|
@ -98,8 +96,7 @@ public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnect
|
|||
|
||||
logger.debug("Received {} on {}", synInfo, stream);
|
||||
|
||||
HTTPChannelOverSPDY channel = new HTTPChannelOverSPDY(connector.getServer(), endPoint.getConnection(),
|
||||
stream);
|
||||
HTTPChannelOverSPDY channel = new HTTPChannelOverSPDY(connector, null, endPoint, stream);
|
||||
stream.setAttribute(CHANNEL_ATTRIBUTE, channel);
|
||||
Headers headers = synInfo.getHeaders();
|
||||
|
||||
|
@ -153,7 +150,7 @@ public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnect
|
|||
}
|
||||
};
|
||||
logger.debug("Queuing last={} content {}", dataInfo.isClose(), copyDataInfo);
|
||||
channel.getEventHandler().content(copyDataInfo.asByteBuffer(true));
|
||||
channel.content(copyDataInfo.asByteBuffer(true));
|
||||
// dataInfos.offer(copyDataInfo); //TODO:
|
||||
// .content()
|
||||
// if (endRequest)
|
||||
|
@ -189,13 +186,13 @@ public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnect
|
|||
private boolean dispatched; // Guarded by synchronization on tasks
|
||||
|
||||
|
||||
public HTTPChannelOverSPDY(Server server, Connection connection, Stream stream)
|
||||
public HTTPChannelOverSPDY(Connector connector, HttpConfiguration configuration, EndPoint endPoint, Stream stream)
|
||||
{
|
||||
super(server, connection, new HttpInput());
|
||||
super(connector, configuration, endPoint, null, new HttpInput());
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
public void handle()
|
||||
{
|
||||
switch (state)
|
||||
|
@ -220,7 +217,7 @@ public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnect
|
|||
}
|
||||
case HEADERS_COMPLETE:
|
||||
{
|
||||
getEventHandler().headerComplete(false, false);
|
||||
headerComplete();
|
||||
}
|
||||
case CONTENT:
|
||||
{
|
||||
|
@ -232,8 +229,8 @@ public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnect
|
|||
}
|
||||
case FINAL:
|
||||
{
|
||||
getEventHandler().messageComplete(0);
|
||||
super.handle();
|
||||
messageComplete(0);
|
||||
super.run();
|
||||
break;
|
||||
}
|
||||
case ASYNC:
|
||||
|
@ -370,7 +367,7 @@ public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnect
|
|||
|
||||
logger.debug("HTTP > {} {} {}", httpMethod, uriString, httpVersion);
|
||||
//TODO: why pass httpMethod and httpMethod.asString() ?
|
||||
getEventHandler().startRequest(httpMethod, httpMethod.asString(), uriString, httpVersion);
|
||||
startRequest(httpMethod, httpMethod.asString(), uriString, httpVersion);
|
||||
|
||||
Headers.Header schemeHeader = headers.get(HTTPSPDYHeader.SCHEME.name(getVersion()));
|
||||
// if (schemeHeader != null) //TODO: thomas
|
||||
|
@ -413,7 +410,7 @@ public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnect
|
|||
String value = header.value();
|
||||
logger.debug("HTTP > {}: {}", name, value);
|
||||
//TODO: Is it safe to pass a null HttpHeader here?
|
||||
getEventHandler().parsedHeader(httpHeader, name, value);
|
||||
parsedHeader(httpHeader, name, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -434,49 +431,49 @@ public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnect
|
|||
return new HttpConfiguration(null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
protected int write(ByteBuffer content) throws IOException
|
||||
{
|
||||
logger.debug("write");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
protected void commitResponse(HttpGenerator.ResponseInfo info, ByteBuffer content) throws IOException
|
||||
{
|
||||
logger.debug("commitResponse");
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
protected int getContentBufferSize()
|
||||
{
|
||||
logger.debug("getContentBufferSize");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
protected void increaseContentBufferSize(int size)
|
||||
{
|
||||
logger.debug("increaseContentBufferSize");
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
protected void resetBuffer()
|
||||
{
|
||||
logger.debug("resetBuffer");
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
protected void flushResponse() throws IOException
|
||||
{
|
||||
logger.debug("flushResponse");
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
protected void completeResponse() throws IOException
|
||||
{
|
||||
logger.debug("completeResponse");
|
||||
getEventHandler().commit();
|
||||
// commit();
|
||||
Response response = getResponse();
|
||||
Headers headers = new Headers();
|
||||
headers.put(HTTPSPDYHeader.VERSION.name(getVersion()), HttpVersion.HTTP_1_1.asString());
|
||||
|
@ -572,7 +569,7 @@ public class ServerHTTPSPDYAsyncConnectionFactory extends ServerSPDYAsyncConnect
|
|||
return pushHeaders;
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
protected void completed()
|
||||
{
|
||||
logger.debug("completed");
|
||||
|
|
|
@ -33,7 +33,6 @@ import javax.servlet.ServletOutputStream;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.sun.xml.internal.ws.util.ByteArrayBuffer;
|
||||
import org.eclipse.jetty.continuation.Continuation;
|
||||
import org.eclipse.jetty.continuation.ContinuationSupport;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
|
@ -952,7 +951,7 @@ public class ServerHTTPSPDYTest extends AbstractHTTPSPDYTest
|
|||
// We use this trick that's present in Jetty code: if we add a request attribute
|
||||
// called "org.eclipse.jetty.server.sendContent", then it will trigger the
|
||||
// content bypass that we want to test
|
||||
request.setAttribute("org.eclipse.jetty.server.sendContent", new ByteArrayBuffer(data));
|
||||
request.setAttribute("org.eclipse.jetty.server.sendContent", ByteBuffer.wrap(data));
|
||||
handlerLatch.countDown();
|
||||
}
|
||||
}), null);
|
||||
|
|
|
@ -35,7 +35,6 @@ import javax.servlet.ServletOutputStream;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.sun.xml.internal.ws.util.ByteArrayBuffer;
|
||||
import org.eclipse.jetty.continuation.Continuation;
|
||||
import org.eclipse.jetty.continuation.ContinuationSupport;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
|
@ -954,7 +953,7 @@ public class ServerHTTPSPDYv2Test extends AbstractHTTPSPDYTest
|
|||
public void testGETWithMediumContentAsBufferByPassed() throws Exception
|
||||
{
|
||||
byte[] data = new byte[2048];
|
||||
testGETWithContentByPassed(new ByteArrayBuffer(data), data.length);
|
||||
testGETWithContentByPassed(ByteBuffer.wrap(data), data.length);
|
||||
}
|
||||
|
||||
private void testGETWithContentByPassed(final Object content, final int length) throws Exception
|
||||
|
|
|
@ -39,9 +39,9 @@ import javax.net.ssl.SSLEngine;
|
|||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.Connection;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.io.SelectChannelEndPoint;
|
||||
import org.eclipse.jetty.io.SelectorManager;
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.ssl.SslConnection;
|
||||
import org.eclipse.jetty.npn.NextProtoNego;
|
||||
import org.eclipse.jetty.server.ConnectionFactory;
|
||||
|
@ -201,7 +201,7 @@ public class SPDYClient
|
|||
{
|
||||
private final Map<String, ConnectionFactory> factories = new ConcurrentHashMap<>();
|
||||
private final Queue<Session> sessions = new ConcurrentLinkedQueue<>();
|
||||
private final ByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
private final ByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
|
||||
private final Executor threadPool;
|
||||
private final SslContextFactory sslContextFactory;
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.nio.channels.SocketChannel;
|
|||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.api.BytesDataInfo;
|
||||
import org.eclipse.jetty.spdy.api.DataInfo;
|
||||
import org.eclipse.jetty.spdy.api.GoAwayInfo;
|
||||
|
@ -83,7 +83,7 @@ public class ClosedStreamTest extends AbstractTest
|
|||
readBuffer.flip();
|
||||
int streamId = readBuffer.getInt(8);
|
||||
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
|
||||
ByteBuffer writeBuffer = generator.control(new SynReplyFrame(SPDY.V2, (byte)0, streamId, new Headers()));
|
||||
channel.write(writeBuffer);
|
||||
|
@ -214,7 +214,7 @@ public class ClosedStreamTest extends AbstractTest
|
|||
}
|
||||
});
|
||||
|
||||
final Generator generator = new Generator(new StandardByteBufferPool(),new StandardCompressionFactory().newCompressor());
|
||||
final Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory().newCompressor());
|
||||
int streamId = 1;
|
||||
ByteBuffer synData = generator.control(new SynStreamFrame(version,SynInfo.FLAG_CLOSE, streamId,0,(byte)0,(short)0,new Headers()));
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.nio.channels.SocketChannel;
|
|||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.api.BytesDataInfo;
|
||||
import org.eclipse.jetty.spdy.api.DataInfo;
|
||||
import org.eclipse.jetty.spdy.api.Headers;
|
||||
|
@ -101,7 +101,7 @@ public class ProtocolViolationsTest extends AbstractTest
|
|||
readBuffer.flip();
|
||||
int streamId = readBuffer.getInt(8);
|
||||
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
byte[] bytes = new byte[1];
|
||||
ByteBuffer writeBuffer = generator.data(streamId, bytes.length, new BytesDataInfo(bytes, true));
|
||||
channel.write(writeBuffer);
|
||||
|
@ -157,7 +157,7 @@ public class ProtocolViolationsTest extends AbstractTest
|
|||
readBuffer.flip();
|
||||
int streamId = readBuffer.getInt(8);
|
||||
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
|
||||
ByteBuffer writeBuffer = generator.control(new SynReplyFrame(SPDY.V2, (byte)0, streamId, new Headers()));
|
||||
channel.write(writeBuffer);
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.api.BytesDataInfo;
|
||||
import org.eclipse.jetty.spdy.api.DataInfo;
|
||||
import org.eclipse.jetty.spdy.api.GoAwayInfo;
|
||||
|
@ -416,7 +416,7 @@ public class PushStreamTest extends AbstractTest
|
|||
}/*TODO, flowControl*/);
|
||||
|
||||
final SocketChannel channel = SocketChannel.open(serverAddress);
|
||||
final Generator generator = new Generator(new StandardByteBufferPool(),new StandardCompressionFactory.StandardCompressor());
|
||||
final Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
int streamId = 1;
|
||||
ByteBuffer writeBuffer = generator.control(new SynStreamFrame(version,(byte)0,streamId,0,(byte)0,(short)0,new Headers()));
|
||||
channel.write(writeBuffer);
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.nio.channels.SocketChannel;
|
|||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.MappedByteBufferPool;
|
||||
import org.eclipse.jetty.spdy.api.Headers;
|
||||
import org.eclipse.jetty.spdy.api.SPDY;
|
||||
import org.eclipse.jetty.spdy.api.Stream;
|
||||
|
@ -64,7 +64,7 @@ public class UnsupportedVersionTest extends AbstractTest
|
|||
});
|
||||
|
||||
SynStreamFrame frame = new SynStreamFrame(SPDY.V2, SynInfo.FLAG_CLOSE, 1, 0, (byte)0, (short)0, new Headers());
|
||||
Generator generator = new Generator(new StandardByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
Generator generator = new Generator(new MappedByteBufferPool(), new StandardCompressionFactory.StandardCompressor());
|
||||
ByteBuffer buffer = generator.control(frame);
|
||||
// Replace the version byte with an unsupported version
|
||||
buffer.putShort(0, (short)0x8001);
|
||||
|
|
|
@ -24,7 +24,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;
|
||||
|
@ -42,7 +42,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;
|
||||
|
@ -103,7 +103,7 @@ public class WebSocketClientFactory extends AggregateLifeCycle
|
|||
|
||||
/**
|
||||
* The address to bind local physical (outgoing) TCP Sockets to.
|
||||
*
|
||||
*
|
||||
* @return the address to bind the socket channel to
|
||||
* @see #setBindAddress(SocketAddress)
|
||||
*/
|
||||
|
|
|
@ -20,7 +20,8 @@ package org.eclipse.jetty.websocket;
|
|||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.StandardByteBufferPool;
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
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 +42,7 @@ public class GeneratorParserRoundtripTest
|
|||
public void testParserAndGenerator() throws Exception
|
||||
{
|
||||
WebSocketPolicy policy = WebSocketPolicy.newServerPolicy();
|
||||
StandardByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
ByteBufferPool bufferPool = new MappedByteBufferPool();
|
||||
Generator gen = new Generator(policy,bufferPool);
|
||||
Parser parser = new Parser(policy);
|
||||
IncomingFramesCapture capture = new IncomingFramesCapture();
|
||||
|
@ -79,7 +80,7 @@ public class GeneratorParserRoundtripTest
|
|||
WebSocketPolicy policy = WebSocketPolicy.newServerPolicy();
|
||||
policy.setMasker(new RandomMasker());
|
||||
|
||||
StandardByteBufferPool bufferPool = new StandardByteBufferPool();
|
||||
ByteBufferPool 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,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);
|
||||
|
|
|
@ -24,7 +24,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);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,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;
|
||||
|
@ -127,7 +127,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();
|
||||
this.generator = new Generator(policy,bufferPool);
|
||||
this.parser = new Parser(policy);
|
||||
this.parseCount = new AtomicInteger(0);
|
||||
|
|
Loading…
Reference in New Issue