refactor rtsp and spdy into separate subprojects
This commit is contained in:
parent
e38bced645
commit
f9b231c1be
81 changed files with 176 additions and 121 deletions
23
NOTICE.txt
23
NOTICE.txt
|
@ -24,7 +24,22 @@ The following changes were performed on the original source code:
|
||||||
|
|
||||||
Challenges for Netty build on JDK 21
|
Challenges for Netty build on JDK 21
|
||||||
|
|
||||||
- unmaintained com.jcraft.jzlib
|
- unmaintained com.jcraft.jzlib, subproject netty-zlib maintains a copy of com.jcraft.zlib
|
||||||
- JCTools uses sun.misc.Unsafe, not VarHandles
|
- JCTools uses sun.misc.Unsafe, not VarHandles, subproject netty-jctools maintains a copy of jctools
|
||||||
- PlatformDependent uses sun.misc.Unsafe
|
- PlatformDependent uses sun.misc.Unsafe. Tests run successful by -add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED and
|
||||||
- finalize() in PoolThreadCache, PoolArena
|
--add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED
|
||||||
|
- finalize() calls in PoolThreadCache, PoolArena are deprecated
|
||||||
|
- when using boringssl static, setting of SSLContent.useTasks to false makes tests hang. Tests using false setting were removed.
|
||||||
|
|
||||||
|
Subproject organization
|
||||||
|
|
||||||
|
Original netty subproject names are not related to package names. I reorganized the names to allow better assignment
|
||||||
|
between subproject name, package name, artifact names, and java module. The following reorgnizations were performed:
|
||||||
|
|
||||||
|
all -> [todo]
|
||||||
|
bom -> [todo]
|
||||||
|
buffer -> netty-buffer
|
||||||
|
codec -> netty-handler-codec, netty-handler-codec-compression, netty-handler-codec-protobuf
|
||||||
|
codec-dns -> [todo]
|
||||||
|
codec-haproxy -> [todo]
|
||||||
|
codec-http -> netty-handler-codec-http, netty-handler-codec-rtsp, netty-handler-codec-spdy
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
group = org.xbib
|
group = org.xbib.netty
|
||||||
name = netty
|
name = netty
|
||||||
version = 4.1.104
|
version = 4.1.104
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class Bzip2BitReader {
|
||||||
/**
|
/**
|
||||||
* The {@link ByteBuf} from which to read data.
|
* The {@link ByteBuf} from which to read data.
|
||||||
*/
|
*/
|
||||||
private ByteBuf in;
|
private ByteBuf byteBuf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A buffer of bits read from the input stream that have not yet been returned.
|
* A buffer of bits read from the input stream that have not yet been returned.
|
||||||
|
@ -46,8 +46,8 @@ public class Bzip2BitReader {
|
||||||
/**
|
/**
|
||||||
* Set the {@link ByteBuf} from which to read data.
|
* Set the {@link ByteBuf} from which to read data.
|
||||||
*/
|
*/
|
||||||
public void setByteBuf(ByteBuf in) {
|
public void setByteBuf(ByteBuf byteBuf) {
|
||||||
this.in = in;
|
this.byteBuf = byteBuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,24 +65,24 @@ public class Bzip2BitReader {
|
||||||
if (bitCount < count) {
|
if (bitCount < count) {
|
||||||
long readData;
|
long readData;
|
||||||
int offset;
|
int offset;
|
||||||
switch (in.readableBytes()) {
|
switch (byteBuf.readableBytes()) {
|
||||||
case 1: {
|
case 1: {
|
||||||
readData = in.readUnsignedByte();
|
readData = byteBuf.readUnsignedByte();
|
||||||
offset = 8;
|
offset = 8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
readData = in.readUnsignedShort();
|
readData = byteBuf.readUnsignedShort();
|
||||||
offset = 16;
|
offset = 16;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
readData = in.readUnsignedMedium();
|
readData = byteBuf.readUnsignedMedium();
|
||||||
offset = 24;
|
offset = 24;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
readData = in.readUnsignedInt();
|
readData = byteBuf.readUnsignedInt();
|
||||||
offset = 32;
|
offset = 32;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ public class Bzip2BitReader {
|
||||||
* Refill the {@link ByteBuf} by one byte.
|
* Refill the {@link ByteBuf} by one byte.
|
||||||
*/
|
*/
|
||||||
public void refill() {
|
public void refill() {
|
||||||
int readData = in.readUnsignedByte();
|
int readData = byteBuf.readUnsignedByte();
|
||||||
bitBuffer = bitBuffer << 8 | readData;
|
bitBuffer = bitBuffer << 8 | readData;
|
||||||
bitCount += 8;
|
bitCount += 8;
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ public class Bzip2BitReader {
|
||||||
* @return {@code true} if one bit is available for reading, otherwise {@code false}
|
* @return {@code true} if one bit is available for reading, otherwise {@code false}
|
||||||
*/
|
*/
|
||||||
public boolean isReadable() {
|
public boolean isReadable() {
|
||||||
return bitCount > 0 || in.isReadable();
|
return bitCount > 0 || byteBuf.isReadable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -139,7 +139,7 @@ public class Bzip2BitReader {
|
||||||
if (count < 0) {
|
if (count < 0) {
|
||||||
throw new IllegalArgumentException("count: " + count + " (expected value greater than 0)");
|
throw new IllegalArgumentException("count: " + count + " (expected value greater than 0)");
|
||||||
}
|
}
|
||||||
return bitCount >= count || (in.readableBytes() << 3 & Integer.MAX_VALUE) >= count - bitCount;
|
return bitCount >= count || (byteBuf.readableBytes() << 3 & Integer.MAX_VALUE) >= count - bitCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,6 @@ dependencies {
|
||||||
implementation project(':netty-bzip2')
|
implementation project(':netty-bzip2')
|
||||||
implementation project(':netty-zlib')
|
implementation project(':netty-zlib')
|
||||||
implementation libs.brotli4j
|
implementation libs.brotli4j
|
||||||
implementation libs.jzlib
|
|
||||||
implementation libs.lz4
|
implementation libs.lz4
|
||||||
implementation libs.lzf
|
implementation libs.lzf
|
||||||
implementation libs.zstd
|
implementation libs.zstd
|
||||||
|
|
3
netty-handler-codec-rtsp/build.gradle
Normal file
3
netty-handler-codec-rtsp/build.gradle
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
dependencies {
|
||||||
|
api project(':netty-handler-codec-http')
|
||||||
|
}
|
|
@ -84,8 +84,8 @@ public class RtspDecoder extends HttpObjectDecoder {
|
||||||
* {@code maxContentLength (8192)}.
|
* {@code maxContentLength (8192)}.
|
||||||
*/
|
*/
|
||||||
public RtspDecoder() {
|
public RtspDecoder() {
|
||||||
this(DEFAULT_MAX_INITIAL_LINE_LENGTH,
|
this(HttpObjectDecoder.DEFAULT_MAX_INITIAL_LINE_LENGTH,
|
||||||
DEFAULT_MAX_HEADER_SIZE,
|
HttpObjectDecoder.DEFAULT_MAX_HEADER_SIZE,
|
||||||
DEFAULT_MAX_CONTENT_LENGTH);
|
DEFAULT_MAX_CONTENT_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ package io.netty.handler.codec.rtsp;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.ByteBufUtil;
|
import io.netty.buffer.ByteBufUtil;
|
||||||
import io.netty.handler.codec.UnsupportedMessageTypeException;
|
import io.netty.handler.codec.UnsupportedMessageTypeException;
|
||||||
|
import io.netty.handler.codec.http.HttpConstants;
|
||||||
import io.netty.handler.codec.http.HttpContent;
|
import io.netty.handler.codec.http.HttpContent;
|
||||||
import io.netty.handler.codec.http.HttpMessage;
|
import io.netty.handler.codec.http.HttpMessage;
|
||||||
import io.netty.handler.codec.http.HttpObjectEncoder;
|
import io.netty.handler.codec.http.HttpObjectEncoder;
|
||||||
|
@ -26,14 +27,12 @@ import io.netty.handler.codec.http.HttpResponse;
|
||||||
import io.netty.util.CharsetUtil;
|
import io.netty.util.CharsetUtil;
|
||||||
import io.netty.util.internal.StringUtil;
|
import io.netty.util.internal.StringUtil;
|
||||||
|
|
||||||
import static io.netty.handler.codec.http.HttpConstants.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encodes an RTSP message represented in {@link HttpMessage} or an {@link HttpContent} into
|
* Encodes an RTSP message represented in {@link HttpMessage} or an {@link HttpContent} into
|
||||||
* a {@link ByteBuf}.
|
* a {@link ByteBuf}.
|
||||||
*/
|
*/
|
||||||
public class RtspEncoder extends HttpObjectEncoder<HttpMessage> {
|
public class RtspEncoder extends HttpObjectEncoder<HttpMessage> {
|
||||||
private static final int CRLF_SHORT = (CR << 8) | LF;
|
private static final int CRLF_SHORT = (HttpConstants.CR << 8) | HttpConstants.LF;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean acceptOutboundMessage(final Object msg)
|
public boolean acceptOutboundMessage(final Object msg)
|
||||||
|
@ -47,17 +46,17 @@ public class RtspEncoder extends HttpObjectEncoder<HttpMessage> {
|
||||||
if (message instanceof HttpRequest) {
|
if (message instanceof HttpRequest) {
|
||||||
HttpRequest request = (HttpRequest) message;
|
HttpRequest request = (HttpRequest) message;
|
||||||
ByteBufUtil.copy(request.method().asciiName(), buf);
|
ByteBufUtil.copy(request.method().asciiName(), buf);
|
||||||
buf.writeByte(SP);
|
buf.writeByte(HttpConstants.SP);
|
||||||
buf.writeCharSequence(request.uri(), CharsetUtil.UTF_8);
|
buf.writeCharSequence(request.uri(), CharsetUtil.UTF_8);
|
||||||
buf.writeByte(SP);
|
buf.writeByte(HttpConstants.SP);
|
||||||
buf.writeCharSequence(request.protocolVersion().toString(), CharsetUtil.US_ASCII);
|
buf.writeCharSequence(request.protocolVersion().toString(), CharsetUtil.US_ASCII);
|
||||||
ByteBufUtil.writeShortBE(buf, CRLF_SHORT);
|
ByteBufUtil.writeShortBE(buf, CRLF_SHORT);
|
||||||
} else if (message instanceof HttpResponse) {
|
} else if (message instanceof HttpResponse) {
|
||||||
HttpResponse response = (HttpResponse) message;
|
HttpResponse response = (HttpResponse) message;
|
||||||
buf.writeCharSequence(response.protocolVersion().toString(), CharsetUtil.US_ASCII);
|
buf.writeCharSequence(response.protocolVersion().toString(), CharsetUtil.US_ASCII);
|
||||||
buf.writeByte(SP);
|
buf.writeByte(HttpConstants.SP);
|
||||||
ByteBufUtil.copy(response.status().codeAsText(), buf);
|
ByteBufUtil.copy(response.status().codeAsText(), buf);
|
||||||
buf.writeByte(SP);
|
buf.writeByte(HttpConstants.SP);
|
||||||
buf.writeCharSequence(response.status().reasonPhrase(), CharsetUtil.US_ASCII);
|
buf.writeCharSequence(response.status().reasonPhrase(), CharsetUtil.US_ASCII);
|
||||||
ByteBufUtil.writeShortBE(buf, CRLF_SHORT);
|
ByteBufUtil.writeShortBE(buf, CRLF_SHORT);
|
||||||
} else {
|
} else {
|
|
@ -15,10 +15,9 @@
|
||||||
*/
|
*/
|
||||||
package io.netty.handler.codec.rtsp;
|
package io.netty.handler.codec.rtsp;
|
||||||
|
|
||||||
import static io.netty.util.internal.ObjectUtil.checkNonEmptyAfterTrim;
|
|
||||||
|
|
||||||
import io.netty.handler.codec.http.HttpMethod;
|
import io.netty.handler.codec.http.HttpMethod;
|
||||||
|
|
||||||
|
import io.netty.util.internal.ObjectUtil;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -119,7 +118,7 @@ public final class RtspMethods {
|
||||||
* will be returned. Otherwise, a new instance will be returned.
|
* will be returned. Otherwise, a new instance will be returned.
|
||||||
*/
|
*/
|
||||||
public static HttpMethod valueOf(String name) {
|
public static HttpMethod valueOf(String name) {
|
||||||
name = checkNonEmptyAfterTrim(name, "name").toUpperCase();
|
name = ObjectUtil.checkNonEmptyAfterTrim(name, "name").toUpperCase();
|
||||||
HttpMethod result = methodMap.get(name);
|
HttpMethod result = methodMap.get(name);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
return result;
|
return result;
|
|
@ -61,7 +61,7 @@ public abstract class RtspObjectDecoder extends HttpObjectDecoder {
|
||||||
* {@code maxContentLength (8192)}.
|
* {@code maxContentLength (8192)}.
|
||||||
*/
|
*/
|
||||||
protected RtspObjectDecoder() {
|
protected RtspObjectDecoder() {
|
||||||
this(DEFAULT_MAX_INITIAL_LINE_LENGTH, DEFAULT_MAX_HEADER_SIZE, DEFAULT_MAX_CONTENT_LENGTH);
|
this(HttpObjectDecoder.DEFAULT_MAX_INITIAL_LINE_LENGTH, HttpObjectDecoder.DEFAULT_MAX_HEADER_SIZE, DEFAULT_MAX_CONTENT_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
8
netty-handler-codec-rtsp/src/main/java/module-info.java
Normal file
8
netty-handler-codec-rtsp/src/main/java/module-info.java
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
module org.xbib.io.netty.handler.codec.rtsp {
|
||||||
|
exports io.netty.handler.codec.rtsp;
|
||||||
|
requires org.xbib.io.netty.buffer;
|
||||||
|
requires org.xbib.io.netty.channel;
|
||||||
|
requires org.xbib.io.netty.handler.codec;
|
||||||
|
requires org.xbib.io.netty.handler.codec.http;
|
||||||
|
requires org.xbib.io.netty.util;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
handlers=java.util.logging.ConsoleHandler
|
||||||
|
.level=ALL
|
||||||
|
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s [%3$s] %5$s %6$s%n
|
||||||
|
java.util.logging.ConsoleHandler.level=ALL
|
||||||
|
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
|
||||||
|
jdk.event.security.level=INFO
|
||||||
|
org.junit.jupiter.engine.execution.ConditionEvaluator.level=OFF
|
6
netty-handler-codec-spdy/build.gradle
Normal file
6
netty-handler-codec-spdy/build.gradle
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
dependencies {
|
||||||
|
api project(':netty-handler-codec-http')
|
||||||
|
implementation project(':netty-zlib')
|
||||||
|
testImplementation testLibs.assertj
|
||||||
|
testImplementation testLibs.mockito.core
|
||||||
|
}
|
10
netty-handler-codec-spdy/src/main/java/module-info.java
Normal file
10
netty-handler-codec-spdy/src/main/java/module-info.java
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
module org.xbib.io.netty.handler.codec.spdy {
|
||||||
|
exports io.netty.handler.codec.spdy;
|
||||||
|
requires org.xbib.io.netty.buffer;
|
||||||
|
requires org.xbib.io.netty.channel;
|
||||||
|
requires org.xbib.io.netty.handler.codec;
|
||||||
|
requires org.xbib.io.netty.handler.codec.compression;
|
||||||
|
requires org.xbib.io.netty.handler.codec.http;
|
||||||
|
requires org.xbib.io.netty.util;
|
||||||
|
requires org.xbib.io.netty.zlib;
|
||||||
|
}
|
|
@ -25,21 +25,18 @@ import org.junit.jupiter.api.Test;
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
import org.mockito.ArgumentMatchers;
|
||||||
|
import org.mockito.Mockito;
|
||||||
|
|
||||||
import static io.netty.handler.codec.spdy.SpdyCodecUtil.SPDY_HEADER_SIZE;
|
import static io.netty.handler.codec.spdy.SpdyCodecUtil.SPDY_HEADER_SIZE;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
|
||||||
import static org.mockito.ArgumentMatchers.anyString;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.times;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
import static org.mockito.Mockito.verifyZeroInteractions;
|
import static org.mockito.Mockito.verifyZeroInteractions;
|
||||||
|
|
||||||
public class SpdyFrameDecoderTest {
|
public class SpdyFrameDecoderTest {
|
||||||
|
|
||||||
private static final Random RANDOM = new Random();
|
private static final Random RANDOM = new Random();
|
||||||
|
|
||||||
private final SpdyFrameDecoderDelegate delegate = mock(SpdyFrameDecoderDelegate.class);
|
private final SpdyFrameDecoderDelegate delegate = Mockito.mock(SpdyFrameDecoderDelegate.class);
|
||||||
private final TestSpdyFrameDecoderDelegate testDelegate = new TestSpdyFrameDecoderDelegate();
|
private final TestSpdyFrameDecoderDelegate testDelegate = new TestSpdyFrameDecoderDelegate();
|
||||||
private SpdyFrameDecoder decoder;
|
private SpdyFrameDecoder decoder;
|
||||||
|
|
||||||
|
@ -165,7 +162,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(RANDOM.nextInt());
|
buf.writeInt(RANDOM.nextInt());
|
||||||
}
|
}
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readDataFrame(streamId, false, buf.slice(SPDY_HEADER_SIZE, length));
|
Mockito.verify(delegate).readDataFrame(streamId, false, buf.slice(SPDY_HEADER_SIZE, length));
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -180,7 +177,7 @@ public class SpdyFrameDecoderTest {
|
||||||
encodeDataFrameHeader(buf, streamId, flags, length);
|
encodeDataFrameHeader(buf, streamId, flags, length);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readDataFrame(streamId, false, Unpooled.EMPTY_BUFFER);
|
Mockito.verify(delegate).readDataFrame(streamId, false, Unpooled.EMPTY_BUFFER);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -195,7 +192,7 @@ public class SpdyFrameDecoderTest {
|
||||||
encodeDataFrameHeader(buf, streamId, flags, length);
|
encodeDataFrameHeader(buf, streamId, flags, length);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readDataFrame(streamId, true, Unpooled.EMPTY_BUFFER);
|
Mockito.verify(delegate).readDataFrame(streamId, true, Unpooled.EMPTY_BUFFER);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -210,7 +207,7 @@ public class SpdyFrameDecoderTest {
|
||||||
encodeDataFrameHeader(buf, streamId, flags, length);
|
encodeDataFrameHeader(buf, streamId, flags, length);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readDataFrame(streamId, false, Unpooled.EMPTY_BUFFER);
|
Mockito.verify(delegate).readDataFrame(streamId, false, Unpooled.EMPTY_BUFFER);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -225,7 +222,7 @@ public class SpdyFrameDecoderTest {
|
||||||
encodeDataFrameHeader(buf, streamId, flags, length);
|
encodeDataFrameHeader(buf, streamId, flags, length);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError((String) any());
|
Mockito.verify(delegate).readFrameError((String) ArgumentMatchers.any());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -242,8 +239,8 @@ public class SpdyFrameDecoderTest {
|
||||||
encodeDataFrameHeader(buf, streamId2, flags, length);
|
encodeDataFrameHeader(buf, streamId2, flags, length);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readDataFrame(streamId1, false, Unpooled.EMPTY_BUFFER);
|
Mockito.verify(delegate).readDataFrame(streamId1, false, Unpooled.EMPTY_BUFFER);
|
||||||
verify(delegate).readDataFrame(streamId2, false, Unpooled.EMPTY_BUFFER);
|
Mockito.verify(delegate).readDataFrame(streamId2, false, Unpooled.EMPTY_BUFFER);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -265,8 +262,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeByte(0);
|
buf.writeByte(0);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
Mockito.verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -288,8 +285,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeByte(0);
|
buf.writeByte(0);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, true, false);
|
Mockito.verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, true, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -311,8 +308,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeByte(0);
|
buf.writeByte(0);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, true);
|
Mockito.verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, true);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -334,8 +331,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeByte(0);
|
buf.writeByte(0);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
Mockito.verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -357,8 +354,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeByte(0);
|
buf.writeByte(0);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
Mockito.verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -380,8 +377,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeByte(0xFF); // should ignore reserved bits
|
buf.writeByte(0xFF); // should ignore reserved bits
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
Mockito.verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -400,7 +397,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(associatedToStreamId);
|
buf.writeInt(associatedToStreamId);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -422,7 +419,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeByte(0);
|
buf.writeByte(0);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -451,9 +448,9 @@ public class SpdyFrameDecoderTest {
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
decoder.decode(headerBlock);
|
decoder.decode(headerBlock);
|
||||||
verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
Mockito.verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
|
||||||
verify(delegate).readHeaderBlock(headerBlock.slice(0, headerBlock.writerIndex()));
|
Mockito.verify(delegate).readHeaderBlock(headerBlock.slice(0, headerBlock.writerIndex()));
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
assertFalse(headerBlock.isReadable());
|
assertFalse(headerBlock.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
|
@ -472,8 +469,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId);
|
buf.writeInt(streamId);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynReplyFrame(streamId, false);
|
Mockito.verify(delegate).readSynReplyFrame(streamId, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -490,8 +487,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId);
|
buf.writeInt(streamId);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynReplyFrame(streamId, true);
|
Mockito.verify(delegate).readSynReplyFrame(streamId, true);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -508,8 +505,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId);
|
buf.writeInt(streamId);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynReplyFrame(streamId, false);
|
Mockito.verify(delegate).readSynReplyFrame(streamId, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -526,8 +523,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId | 0x80000000); // should ignore reserved bit
|
buf.writeInt(streamId | 0x80000000); // should ignore reserved bit
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSynReplyFrame(streamId, false);
|
Mockito.verify(delegate).readSynReplyFrame(streamId, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
|
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
|
@ -543,7 +540,7 @@ public class SpdyFrameDecoderTest {
|
||||||
encodeControlFrameHeader(buf, type, flags, length);
|
encodeControlFrameHeader(buf, type, flags, length);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -560,7 +557,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId);
|
buf.writeInt(streamId);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -584,9 +581,9 @@ public class SpdyFrameDecoderTest {
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
decoder.decode(headerBlock);
|
decoder.decode(headerBlock);
|
||||||
verify(delegate).readSynReplyFrame(streamId, false);
|
Mockito.verify(delegate).readSynReplyFrame(streamId, false);
|
||||||
verify(delegate).readHeaderBlock(headerBlock.slice(0, headerBlock.writerIndex()));
|
Mockito.verify(delegate).readHeaderBlock(headerBlock.slice(0, headerBlock.writerIndex()));
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
assertFalse(headerBlock.isReadable());
|
assertFalse(headerBlock.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
|
@ -607,7 +604,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readRstStreamFrame(streamId, statusCode);
|
Mockito.verify(delegate).readRstStreamFrame(streamId, statusCode);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -626,7 +623,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readRstStreamFrame(streamId, statusCode);
|
Mockito.verify(delegate).readRstStreamFrame(streamId, statusCode);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -645,7 +642,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -664,7 +661,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -683,7 +680,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -702,7 +699,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -728,8 +725,8 @@ public class SpdyFrameDecoderTest {
|
||||||
|
|
||||||
delegate.readSettingsEnd();
|
delegate.readSettingsEnd();
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSettingsFrame(false);
|
Mockito.verify(delegate).readSettingsFrame(false);
|
||||||
verify(delegate, times(numSettings)).readSetting(id, value, false, false);
|
Mockito.verify(delegate, Mockito.times(numSettings)).readSetting(id, value, false, false);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -746,8 +743,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(numSettings);
|
buf.writeInt(numSettings);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSettingsFrame(false);
|
Mockito.verify(delegate).readSettingsFrame(false);
|
||||||
verify(delegate).readSettingsEnd();
|
Mockito.verify(delegate).readSettingsEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -764,8 +761,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(numSettings);
|
buf.writeInt(numSettings);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSettingsFrame(true);
|
Mockito.verify(delegate).readSettingsFrame(true);
|
||||||
verify(delegate).readSettingsEnd();
|
Mockito.verify(delegate).readSettingsEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -791,8 +788,8 @@ public class SpdyFrameDecoderTest {
|
||||||
|
|
||||||
delegate.readSettingsEnd();
|
delegate.readSettingsEnd();
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSettingsFrame(false);
|
Mockito.verify(delegate).readSettingsFrame(false);
|
||||||
verify(delegate, times(numSettings)).readSetting(id, value, true, false);
|
Mockito.verify(delegate, Mockito.times(numSettings)).readSetting(id, value, true, false);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -818,8 +815,8 @@ public class SpdyFrameDecoderTest {
|
||||||
|
|
||||||
delegate.readSettingsEnd();
|
delegate.readSettingsEnd();
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSettingsFrame(false);
|
Mockito.verify(delegate).readSettingsFrame(false);
|
||||||
verify(delegate, times(numSettings)).readSetting(id, value, false, true);
|
Mockito.verify(delegate, Mockito.times(numSettings)).readSetting(id, value, false, true);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -836,8 +833,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(numSettings);
|
buf.writeInt(numSettings);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSettingsFrame(false);
|
Mockito.verify(delegate).readSettingsFrame(false);
|
||||||
verify(delegate).readSettingsEnd();
|
Mockito.verify(delegate).readSettingsEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -863,8 +860,8 @@ public class SpdyFrameDecoderTest {
|
||||||
|
|
||||||
delegate.readSettingsEnd();
|
delegate.readSettingsEnd();
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readSettingsFrame(false);
|
Mockito.verify(delegate).readSettingsFrame(false);
|
||||||
verify(delegate, times(numSettings)).readSetting(id, value, false, false);
|
Mockito.verify(delegate, Mockito.times(numSettings)).readSetting(id, value, false, false);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -889,7 +886,7 @@ public class SpdyFrameDecoderTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -914,7 +911,7 @@ public class SpdyFrameDecoderTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -988,7 +985,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(id);
|
buf.writeInt(id);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readPingFrame(id);
|
Mockito.verify(delegate).readPingFrame(id);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1005,7 +1002,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(id);
|
buf.writeInt(id);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readPingFrame(id);
|
Mockito.verify(delegate).readPingFrame(id);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1022,7 +1019,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(id);
|
buf.writeInt(id);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1041,7 +1038,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readGoAwayFrame(lastGoodStreamId, statusCode);
|
Mockito.verify(delegate).readGoAwayFrame(lastGoodStreamId, statusCode);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1060,7 +1057,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readGoAwayFrame(lastGoodStreamId, statusCode);
|
Mockito.verify(delegate).readGoAwayFrame(lastGoodStreamId, statusCode);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1079,7 +1076,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readGoAwayFrame(lastGoodStreamId, statusCode);
|
Mockito.verify(delegate).readGoAwayFrame(lastGoodStreamId, statusCode);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1098,7 +1095,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(statusCode);
|
buf.writeInt(statusCode);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1115,8 +1112,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId);
|
buf.writeInt(streamId);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readHeadersFrame(streamId, false);
|
Mockito.verify(delegate).readHeadersFrame(streamId, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1133,8 +1130,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId);
|
buf.writeInt(streamId);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readHeadersFrame(streamId, true);
|
Mockito.verify(delegate).readHeadersFrame(streamId, true);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1151,8 +1148,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId);
|
buf.writeInt(streamId);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readHeadersFrame(streamId, false);
|
Mockito.verify(delegate).readHeadersFrame(streamId, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1169,8 +1166,8 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId | 0x80000000); // should ignore reserved bit
|
buf.writeInt(streamId | 0x80000000); // should ignore reserved bit
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readHeadersFrame(streamId, false);
|
Mockito.verify(delegate).readHeadersFrame(streamId, false);
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1185,7 +1182,7 @@ public class SpdyFrameDecoderTest {
|
||||||
encodeControlFrameHeader(buf, type, flags, length);
|
encodeControlFrameHeader(buf, type, flags, length);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1202,7 +1199,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(streamId);
|
buf.writeInt(streamId);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1225,9 +1222,9 @@ public class SpdyFrameDecoderTest {
|
||||||
}
|
}
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
decoder.decode(headerBlock);
|
decoder.decode(headerBlock);
|
||||||
verify(delegate).readHeadersFrame(streamId, false);
|
Mockito.verify(delegate).readHeadersFrame(streamId, false);
|
||||||
verify(delegate).readHeaderBlock(headerBlock.slice(0, headerBlock.writerIndex()));
|
Mockito.verify(delegate).readHeaderBlock(headerBlock.slice(0, headerBlock.writerIndex()));
|
||||||
verify(delegate).readHeaderBlockEnd();
|
Mockito.verify(delegate).readHeaderBlockEnd();
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
assertFalse(headerBlock.isReadable());
|
assertFalse(headerBlock.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
|
@ -1248,7 +1245,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(deltaWindowSize);
|
buf.writeInt(deltaWindowSize);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readWindowUpdateFrame(streamId, deltaWindowSize);
|
Mockito.verify(delegate).readWindowUpdateFrame(streamId, deltaWindowSize);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1266,7 +1263,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(deltaWindowSize);
|
buf.writeInt(deltaWindowSize);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readWindowUpdateFrame(streamId, deltaWindowSize);
|
Mockito.verify(delegate).readWindowUpdateFrame(streamId, deltaWindowSize);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1285,7 +1282,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(deltaWindowSize | 0x80000000); // should ignore reserved bit
|
buf.writeInt(deltaWindowSize | 0x80000000); // should ignore reserved bit
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readWindowUpdateFrame(streamId, deltaWindowSize);
|
Mockito.verify(delegate).readWindowUpdateFrame(streamId, deltaWindowSize);
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1304,7 +1301,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(deltaWindowSize);
|
buf.writeInt(deltaWindowSize);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
||||||
|
@ -1323,7 +1320,7 @@ public class SpdyFrameDecoderTest {
|
||||||
buf.writeInt(deltaWindowSize);
|
buf.writeInt(deltaWindowSize);
|
||||||
|
|
||||||
decoder.decode(buf);
|
decoder.decode(buf);
|
||||||
verify(delegate).readFrameError(anyString());
|
Mockito.verify(delegate).readFrameError(ArgumentMatchers.anyString());
|
||||||
assertFalse(buf.isReadable());
|
assertFalse(buf.isReadable());
|
||||||
buf.release();
|
buf.release();
|
||||||
}
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
handlers=java.util.logging.ConsoleHandler
|
||||||
|
.level=ALL
|
||||||
|
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s [%3$s] %5$s %6$s%n
|
||||||
|
java.util.logging.ConsoleHandler.level=ALL
|
||||||
|
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
|
||||||
|
jdk.event.security.level=INFO
|
||||||
|
org.junit.jupiter.engine.execution.ConditionEvaluator.level=OFF
|
|
@ -12,6 +12,8 @@ module org.xbib.io.netty.util {
|
||||||
org.xbib.io.netty.handler.codec.http,
|
org.xbib.io.netty.handler.codec.http,
|
||||||
org.xbib.io.netty.handler.codec.httptwo,
|
org.xbib.io.netty.handler.codec.httptwo,
|
||||||
org.xbib.io.netty.handler.codec.protobuf,
|
org.xbib.io.netty.handler.codec.protobuf,
|
||||||
|
org.xbib.io.netty.handler.codec.rtsp,
|
||||||
|
org.xbib.io.netty.handler.codec.spdy,
|
||||||
org.xbib.io.netty.handler.ssl,
|
org.xbib.io.netty.handler.ssl,
|
||||||
org.xbib.io.netty.resolver;
|
org.xbib.io.netty.resolver;
|
||||||
exports io.netty.util.internal.logging to
|
exports io.netty.util.internal.logging to
|
||||||
|
@ -24,6 +26,8 @@ module org.xbib.io.netty.util {
|
||||||
org.xbib.io.netty.handler.codec.http,
|
org.xbib.io.netty.handler.codec.http,
|
||||||
org.xbib.io.netty.handler.codec.httptwo,
|
org.xbib.io.netty.handler.codec.httptwo,
|
||||||
org.xbib.io.netty.handler.codec.protobuf,
|
org.xbib.io.netty.handler.codec.protobuf,
|
||||||
|
org.xbib.io.netty.handler.codec.rtsp,
|
||||||
|
org.xbib.io.netty.handler.codec.spdy,
|
||||||
org.xbib.io.netty.handler.ssl,
|
org.xbib.io.netty.handler.ssl,
|
||||||
org.xbib.io.netty.resolver;
|
org.xbib.io.netty.resolver;
|
||||||
requires org.xbib.io.netty.jctools;
|
requires org.xbib.io.netty.jctools;
|
||||||
|
|
|
@ -20,7 +20,6 @@ dependencyResolutionManagement {
|
||||||
library('bouncycastle', 'org.bouncycastle', 'bcpkix-jdk18on').version('1.77')
|
library('bouncycastle', 'org.bouncycastle', 'bcpkix-jdk18on').version('1.77')
|
||||||
library('conscrypt', 'org.conscrypt', 'conscrypt-openjdk-uber').version('2.5.2')
|
library('conscrypt', 'org.conscrypt', 'conscrypt-openjdk-uber').version('2.5.2')
|
||||||
library('brotli4j', 'com.aayushatharva.brotli4j', 'brotli4j').versionRef('brotli4j')
|
library('brotli4j', 'com.aayushatharva.brotli4j', 'brotli4j').versionRef('brotli4j')
|
||||||
library('jzlib', 'com.jcraft', 'jzlib').version('1.1.3')
|
|
||||||
library('lz4', 'org.lz4', 'lz4-java').version('1.8.0')
|
library('lz4', 'org.lz4', 'lz4-java').version('1.8.0')
|
||||||
library('lzf', 'com.ning', 'compress-lzf').version('1.1.2')
|
library('lzf', 'com.ning', 'compress-lzf').version('1.1.2')
|
||||||
library('zstd', 'com.github.luben', 'zstd-jni').version('1.5.5-11')
|
library('zstd', 'com.github.luben', 'zstd-jni').version('1.5.5-11')
|
||||||
|
@ -68,6 +67,8 @@ include 'netty-handler-codec-compression'
|
||||||
include 'netty-handler-codec-http'
|
include 'netty-handler-codec-http'
|
||||||
include 'netty-handler-codec-http2'
|
include 'netty-handler-codec-http2'
|
||||||
include 'netty-handler-codec-protobuf'
|
include 'netty-handler-codec-protobuf'
|
||||||
|
include 'netty-handler-codec-rtsp'
|
||||||
|
include 'netty-handler-codec-spdy'
|
||||||
include 'netty-handler-ssl'
|
include 'netty-handler-ssl'
|
||||||
include 'netty-internal-tcnative'
|
include 'netty-internal-tcnative'
|
||||||
include 'netty-resolver'
|
include 'netty-resolver'
|
||||||
|
|
Loading…
Reference in a new issue