GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge branch '4.2' into fix-ssl-wrap-multiple-before-handshake · netty/netty@6ec3206

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github
    • scripts
      • affected_includes.sh
      • detect_affected_modules.sh
      • mvn_affected.sh
    • workflows
      • ci-pr.yml
  • codec-compression/src
    • main/java/io/netty/handler/codec/compression
      • Bzip2Decoder.java
      • Bzip2Decompressor.java
    • test/java/io/netty/handler/codec/compression
      • Bzip2DecoderTest.java
      • Bzip2DecompressorTest.java
      • Bzip2MalformedStreams.java
  • codec-http/src
    • main/java/io/netty/handler/codec/http/websocketx/extensions/compression
      • DeflateEncoder.java
    • test/java/io/netty/handler/codec/http/websocketx/extensions/compression
      • PerMessageDeflateEncoderTest.java
  • codec-mqtt/src
    • main/java/io/netty/handler/codec/mqtt
      • MqttDecoder.java
    • test/java/io/netty/handler/codec/mqtt
      • MqttCodecTest.java
  • common/src
    • main/resources/META-INF/native-image/io.netty/netty-common
      • native-image.properties
    • test/java/io/netty/util/concurrent
      • SystemTickerNativeImageConfigurationTest.java
  • docker
    • docker-compose.al2023.yaml
    • docker-compose.centos-7.111.yaml
    • docker-compose.centos-7.117.yaml
    • docker-compose.centos-7.21.yaml
    • docker-compose.centos-7.24.yaml
    • docker-compose.centos-7.25.yaml
    • docker-compose.centos-7.26.yaml
    • docker-compose.centos-7.graalvm121.yaml
    • docker-compose.yaml
  • handler/src
    • main/java/io/netty/handler
      • ssl
        • SignatureAlgorithmConverter.java
      • stream
        • ChunkedNioFile.java
    • test/java/io/netty/handler
      • ssl
        • PkiTestingTlsTest.java
        • SignatureAlgorithmConverterTest.java
      • stream
        • ChunkedWriteHandlerTest.java
  • transport/src
    • main/java/io/netty/channel
      • ChannelOutboundBuffer.java
    • test/java/io/netty/channel
      • ChannelOutboundBufferTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/scripts/build_affected_only.sh‎ ‎.github/scripts/affected_includes.sh‎.github/scripts/build_affected_only.sh renamed to .github/scripts/affected_includes.sh

Copy file name to clipboard
+13-13Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# ----------------------------------------------------------------------------
3-
# Copyright 2021 The Netty Project
3+
# Copyright 2026 The Netty Project
44
#
55
# The Netty Project licenses this file to you under the Apache License,
66
# version 2.0 (the "License"); you may not use this file except in compliance
@@ -14,20 +14,20 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616
# ----------------------------------------------------------------------------
17+
#
18+
# Exits with 0 if the given module is part of the build as selected by NETTY_AFFECTED_MODULES
19+
# (see mvn_affected.sh) and with 1 otherwise.
20+
#
21+
# Usage: affected_includes.sh <module>
1722
set -e
1823

19-
if [ "$#" -lt 2 ]; then
20-
echo "Expected branch and maven arguments"
24+
if [ "$#" -ne 1 ]; then
25+
echo "Usage: $0 <module>" >&2
2126
exit 1
2227
fi
2328

24-
MODULES=$(git diff --name-only "$1" | cut -d '/' -f 1 | sort -u | sed -n -e 'H;${x;s/\n/,/g;s/^,//;p;}')
25-
MAVEN_ARGUMENTS=${*:2}
26-
if [ -z "$MODULES" ]; then
27-
echo "No changes detected, skipping build"
28-
exit 0
29-
fi
30-
echo "Changes detected, start the build"
31-
echo "./mvnw -pl $MODULES -amd $MAVEN_ARGUMENTS"
32-
./mvnw -pl "$MODULES" -amd "${@:2}"
33-
29+
case "${NETTY_AFFECTED_MODULES:-ALL}" in
30+
ALL) exit 0 ;;
31+
NONE) exit 1 ;;
32+
*) case ",$NETTY_AFFECTED_MODULES," in *",$1,"*) exit 0 ;; *) exit 1 ;; esac ;;
33+
esac
Collapse file

‎.github/scripts/detect_affected_modules.sh‎

Copy file name to clipboard
+89Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/bin/bash
2+
# ----------------------------------------------------------------------------
3+
# Copyright 2026 The Netty Project
4+
#
5+
# The Netty Project licenses this file to you under the Apache License,
6+
# version 2.0 (the "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at:
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
# ----------------------------------------------------------------------------
17+
#
18+
# Prints which maven modules are affected by the changes between <base-rev> and HEAD:
19+
#
20+
# ALL a change outside of a single module (root pom, build setup, CI, dev-tools ...) so
21+
# everything needs to be built
22+
# NONE only files that can't influence the build (docs, license files ...) changed
23+
# a,b,c comma separated list of modules that contain changes
24+
#
25+
# Usage: detect_affected_modules.sh <base-rev>
26+
#
27+
# The diff is taken against the merge-base of <base-rev> and HEAD, so this works for a local branch
28+
# (e.g. origin/4.2) as well as for the merge commit GitHub checks out for pull requests (HEAD^1).
29+
set -e
30+
31+
if [ "$#" -ne 1 ]; then
32+
echo "Usage: $0 <base-rev>" >&2
33+
exit 1
34+
fi
35+
36+
cd "$(git rev-parse --show-toplevel)"
37+
38+
BASE=$1
39+
if MERGE_BASE=$(git merge-base "$BASE" HEAD 2>/dev/null); then
40+
BASE=$MERGE_BASE
41+
fi
42+
43+
# All modules are declared as top-level directories in the root pom.
44+
ALL_MODULES=",$(sed -n 's:.*<module>\(.*\)</module>.*:\1:p' pom.xml | tr '\n' ','),"
45+
46+
# Modules that influence every other module (checkstyle config etc.) and so can't be built in isolation.
47+
GLOBAL_MODULES=",dev-tools,"
48+
49+
# Changed files that never influence the build. Everything else outside of a module forces a full build.
50+
is_ignorable() {
51+
case "$1" in
52+
*.md|LICENSE*|NOTICE*|license/*|.gitignore|.gitattributes|.editorconfig|.github/ISSUE_TEMPLATE/*|.github/*.md) return 0 ;;
53+
*) return 1 ;;
54+
esac
55+
}
56+
57+
SELECTED=""
58+
# --no-renames so that both the old and the new location of a moved file are reported.
59+
CHANGED=$(git diff --name-only --no-renames "$BASE" HEAD)
60+
while IFS= read -r file; do
61+
[ -z "$file" ] && continue
62+
top=${file%%/*}
63+
if [ "$top" = "$file" ] || ! case "$ALL_MODULES" in *",$top,"*) true ;; *) false ;; esac; then
64+
# Not part of a module.
65+
if is_ignorable "$file"; then
66+
continue
67+
fi
68+
echo ALL
69+
exit 0
70+
fi
71+
if is_ignorable "$file"; then
72+
continue
73+
fi
74+
case "$GLOBAL_MODULES" in
75+
*",$top,"*) echo ALL; exit 0 ;;
76+
esac
77+
case ",$SELECTED," in
78+
*",$top,"*) ;;
79+
*) SELECTED="${SELECTED:+$SELECTED,}$top" ;;
80+
esac
81+
done <<EOT
82+
$CHANGED
83+
EOT
84+
85+
if [ -z "$SELECTED" ]; then
86+
echo NONE
87+
else
88+
echo "$SELECTED"
89+
fi
Collapse file

‎.github/scripts/mvn_affected.sh‎

Copy file name to clipboard
+59Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
# ----------------------------------------------------------------------------
3+
# Copyright 2026 The Netty Project
4+
#
5+
# The Netty Project licenses this file to you under the Apache License,
6+
# version 2.0 (the "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at:
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
# ----------------------------------------------------------------------------
17+
#
18+
# Drop-in replacement for ./mvnw that can restrict the build to the modules affected by a change.
19+
# The modules are taken from the NETTY_AFFECTED_MODULES environment variable, see detect_affected_modules.sh:
20+
#
21+
# unset / empty / ALL behaves exactly like ./mvnw (full build)
22+
# NONE nothing to do
23+
# a,b,c build a, b and c and the modules they depend on (-am) without running tests, then run
24+
# the full lifecycle (including the tests) for a, b and c only.
25+
#
26+
# Modules that depend on the affected modules are intentionally not built. The one full build that is done
27+
# per PR covers them.
28+
#
29+
# Usage: mvn_affected.sh <maven arguments>
30+
#
31+
# NETTY_MVN can be used to override the maven executable (default ./mvnw).
32+
set -e
33+
34+
cd "$(dirname "$0")/../.."
35+
36+
MVN=${NETTY_MVN:-./mvnw}
37+
AFFECTED=${NETTY_AFFECTED_MODULES:-ALL}
38+
39+
case "$AFFECTED" in
40+
ALL)
41+
exec "$MVN" "$@"
42+
;;
43+
NONE)
44+
echo "No module affected by the changes, skipping build"
45+
exit 0
46+
;;
47+
esac
48+
49+
# Second pass operates on the output of the first one, so don't clean it away again.
50+
ARGS_WITHOUT_CLEAN=()
51+
for arg in "$@"; do
52+
[ "$arg" = "clean" ] || ARGS_WITHOUT_CLEAN+=("$arg")
53+
done
54+
55+
echo "Building affected modules: $AFFECTED"
56+
echo "Pass 1/2: build (and install) $AFFECTED and their dependencies without tests"
57+
"$MVN" "$@" -pl "$AFFECTED" -am -DskipTests=true
58+
echo "Pass 2/2: run the tests of $AFFECTED"
59+
"$MVN" "${ARGS_WITHOUT_CLEAN[@]}" -pl "$AFFECTED"
Collapse file

‎.github/workflows/ci-pr.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/ci-pr.yml
+53-13Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,33 @@ concurrency:
3535
cancel-in-progress: true
3636

3737
jobs:
38+
# Figures out which modules are touched by the PR so the (expensive) test legs below can be restricted
39+
# to them. See .github/scripts/detect_affected_modules.sh for the rules, anything that can't be mapped to
40+
# a module results in a full build.
41+
detect-affected:
42+
runs-on: ubuntu-24.04
43+
outputs:
44+
modules: ${{ steps.detect.outputs.modules }}
45+
steps:
46+
# Pinned to v5.1.0
47+
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
48+
with:
49+
# For pull requests this is the merge commit, we need its first parent (the base branch) to diff against.
50+
fetch-depth: 2
51+
52+
- name: Detect affected modules
53+
id: detect
54+
run: |
55+
modules=ALL
56+
if [ "${{ github.event_name }}" = "pull_request" ]; then
57+
modules=$(./.github/scripts/detect_affected_modules.sh HEAD^1) || {
58+
echo "::warning::Could not detect the affected modules, falling back to a full build"
59+
modules=ALL
60+
}
61+
fi
62+
echo "modules=$modules" >> "$GITHUB_OUTPUT"
63+
echo "Affected modules: $modules" | tee -a "$GITHUB_STEP_SUMMARY"
64+
3865
verify-pr:
3966
runs-on: ubuntu-22.04
4067
steps:
@@ -69,7 +96,7 @@ jobs:
6996
build-pr-windows:
7097
runs-on: windows-2022
7198
name: windows-x86_64-java11-boringssl
72-
needs: verify-pr
99+
needs: [verify-pr, detect-affected]
73100
env:
74101
# Let's limit the amount of ram that is used to unpack rustup as we saw
75102
# failures sometimes due the fact that not enough memory could be reserved.
@@ -122,7 +149,14 @@ jobs:
122149
uses: testlens-app/setup-testlens@d29a2be31512b3aeda3adcef09fbe0d55af90c51 # Pin 1.9.4
123150

124151
- name: Build project
125-
run: ./mvnw.cmd -B -ntp --file pom.xml clean package -Pboringssl -DskipHttp2Testsuite=true -DskipAutobahnTestsuite=true
152+
# Run through bash (git bash is part of the runner image) as mvn_affected.sh is a bash script.
153+
# install (not package) as the modules that are not part of the affected set are resolved from the local repository.
154+
shell: bash
155+
env:
156+
# ALL, NONE or the comma separated list of modules, see .github/scripts/mvn_affected.sh
157+
NETTY_AFFECTED_MODULES: ${{ needs.detect-affected.outputs.modules }}
158+
NETTY_MVN: ./mvnw.cmd
159+
run: ./.github/scripts/mvn_affected.sh -B -ntp --file pom.xml clean install -Pboringssl -DskipHttp2Testsuite=true -DskipAutobahnTestsuite=true
126160

127161
- name: print JVM thread dumps when cancelled
128162
uses: ./.github/actions/thread-dump-jvms
@@ -211,42 +245,44 @@ jobs:
211245
include:
212246
- setup: linux-x86_64-java11
213247
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml build"
214-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml run build"
248+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml run build-affected-only"
215249
- setup: linux-x86_64-java21-graal
216250
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.graalvm121.yaml build"
217-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.graalvm121.yaml run build"
251+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.graalvm121.yaml run build-affected-only"
218252
- setup: linux-x86_64-java17
219253
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.117.yaml build"
220-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.117.yaml run build"
254+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.117.yaml run build-affected-only"
221255
- setup: linux-x86_64-java21
222256
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.21.yaml build"
223-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.21.yaml run build-with-oio-testsuite"
257+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.21.yaml run build-with-oio-testsuite-affected-only"
224258
- setup: linux-x86_64-java24
225259
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.24.yaml build"
226-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.24.yaml run build"
260+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.24.yaml run build-affected-only"
227261
- setup: linux-x86_64-java25
228262
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.25.yaml build"
229-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.25.yaml run build"
263+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.25.yaml run build-affected-only"
230264
- setup: linux-x86_64-java26
231265
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.26.yaml build"
232-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.26.yaml run build"
266+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.26.yaml run build-affected-only"
267+
# The one leg that always builds and tests everything (with leak detection), so leaks in modules
268+
# depending on a changed one are still found. All the other legs only build the affected modules.
233269
- setup: linux-x86_64-java11-boringssl
234270
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml build"
235271
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml run build-leak-boringssl-static"
236272
- setup: linux-x86_64-java11-pooled
237273
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml build"
238-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml run build-leak-pooled"
274+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml run build-leak-pooled-affected-only"
239275
- setup: linux-x86_64-java11-boringssl-jdk8-tests
240276
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml build"
241-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml run build-boringssl-static-jdk8-tests"
277+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.centos-7.111.yaml run build-boringssl-static-jdk8-tests-affected-only"
242278
- setup: linux-x86_64-java11-awslc
243279
docker-compose-build: "-f docker/docker-compose.yaml -f docker/docker-compose.al2023.yaml build"
244280
docker-compose-install-tcnative: "-f docker/docker-compose.yaml -f docker/docker-compose.al2023.yaml run install-tcnative"
245281
docker-compose-update-tcnative-version: "-f docker/docker-compose.yaml -f docker/docker-compose.al2023.yaml run update-tcnative-version"
246-
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.al2023.yaml run build"
282+
docker-compose-run: "-f docker/docker-compose.yaml -f docker/docker-compose.al2023.yaml run build-affected-only"
247283

248284
name: ${{ matrix.setup }} build
249-
needs: verify-pr
285+
needs: [verify-pr, detect-affected]
250286
permissions:
251287
contents: read
252288
packages: write # to push the docker build cache to ghcr.io; no-op (ignored) for fork PRs
@@ -331,6 +367,10 @@ jobs:
331367
run: docker compose ${{ matrix.docker-compose-update-tcnative-version }}
332368

333369
- name: Build project with leak detection
370+
env:
371+
# ALL, NONE or the comma separated list of modules, only used by the build-affected-only service
372+
# (see .github/scripts/mvn_affected.sh), all other services always build everything.
373+
NETTY_AFFECTED_MODULES: ${{ needs.detect-affected.outputs.modules }}
334374
run: docker compose ${{ matrix.docker-compose-run }} | tee build-leak.output
335375

336376
- name: Checking for test failures
Collapse file

‎codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2Decoder.java‎

Copy file name to clipboardExpand all lines: codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2Decoder.java
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) t
223223
int index = 0;
224224
while (reader.readBoolean()) {
225225
index++;
226+
if (index >= huffmanStageDecoder.totalTables) {
227+
throw new DecompressionException("incorrect selector index " + index);
228+
}
226229
}
227230
selectors[currSelector] = tableMtf.indexToFront(index);
228231
}
Collapse file

‎codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2Decompressor.java‎

Copy file name to clipboardExpand all lines: codec-compression/src/main/java/io/netty/handler/codec/compression/Bzip2Decompressor.java
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ void processInput(ByteBuf buf) throws DecompressionException {
224224
int index = 0;
225225
while (reader.readBoolean()) {
226226
index++;
227+
if (index >= huffmanStageDecoder.totalTables) {
228+
throw new DecompressionException("incorrect selector index " + index);
229+
}
227230
}
228231
selectors[currSelector] = tableMtf.indexToFront(index);
229232
}
Collapse file

‎codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2DecoderTest.java‎

Copy file name to clipboardExpand all lines: codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2DecoderTest.java
+28-1Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private void writeInboundDestroyAndExpectDecompressionException(ByteBuf in) {
5353
try {
5454
channel.writeInbound(in);
5555
} finally {
56-
assertThrows(DecompressionException.class, () -> destroyChannel());
56+
assertThrows(DecompressionException.class, this::destroyChannel);
5757
}
5858
}
5959

@@ -142,6 +142,9 @@ public void execute() {
142142
channel.writeInbound(in);
143143
}
144144
}, "incorrect huffman groups number");
145+
// Leftover cumulation bytes get reprocessed from stale decoder state when the
146+
// channel is torn down, which can legitimately raise a second, unrelated exception.
147+
assertThrows(DecompressionException.class, this::destroyChannel);
145148
}
146149

147150
@Test
@@ -156,6 +159,9 @@ public void execute() {
156159
channel.writeInbound(in);
157160
}
158161
}, "incorrect selectors number");
162+
// Leftover cumulation bytes get reprocessed from stale decoder state when the
163+
// channel is torn down, which can legitimately raise a second, unrelated exception.
164+
assertThrows(DecompressionException.class, this::destroyChannel);
159165
}
160166

161167
@Test
@@ -269,6 +275,27 @@ public void testWellFormedFourByteRleRunAtBlockEnd() throws Exception {
269275
}
270276
}
271277

278+
/**
279+
* Regression test: the unary-coded MTF selector index read in {@code RECEIVE_SELECTORS} was
280+
* never validated against the number of declared Huffman tables before being used to index
281+
* into {@link Bzip2MoveToFrontTable} and later the per-table code-limit array, allowing a
282+
* crafted stream to trigger an {@link ArrayIndexOutOfBoundsException} instead of a clean
283+
* {@link DecompressionException}.
284+
*/
285+
@Test
286+
public void testSelectorIndexOutOfRange() {
287+
final ByteBuf in = Unpooled.wrappedBuffer(Bzip2MalformedStreams.selectorIndexOutOfRange());
288+
assertThrows(DecompressionException.class, new Executable() {
289+
@Override
290+
public void execute() {
291+
channel.writeInbound(in);
292+
}
293+
}, "incorrect selector index");
294+
// Leftover cumulation bytes get reprocessed from stale decoder state when the
295+
// channel is torn down, which can legitimately raise a second, unrelated exception.
296+
assertThrows(DecompressionException.class, this::destroyChannel);
297+
}
298+
272299
@Override
273300
protected byte[] compress(byte[] data) throws Exception {
274301
ByteArrayOutputStream os = new ByteArrayOutputStream();

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.