Skip to content

Avoid writing padding bytes if no content is inflated#31

Merged
LloydW93 merged 1 commit intocloudflare:gcc.amd64from
DanielThomas:dannyt/chromium-issue-1302606
Sep 22, 2022
Merged

Avoid writing padding bytes if no content is inflated#31
LloydW93 merged 1 commit intocloudflare:gcc.amd64from
DanielThomas:dannyt/chromium-issue-1302606

Conversation

@DanielThomas
Copy link
Copy Markdown

Port the change for Chromium issue 1302606 which avoids writing padding bytes for debug purposes except for debug builds. In particular, this ensures that the JDK InflaterInputStream::read(byte[] b, int off, int len) contract can be satisfied by this implementation. See:

This is complementary to the work Volker Simonis is doing upstream on making InflaterInputStream more tolerant of this kind of behavior, providing compatibility for earlier JDK releases.

Port the change for Chromium issue 1302606 which avoids writing padding bytes for debug purposes except for debug builds. In particular, this ensures that the JDK `InflaterInputStream::read(byte[] b, int off, int len)` contract can be satisfied by this implementation. See:

- https://bugs.chromium.org/p/chromium/issues/detail?id=1302606
- https://chromium.googlesource.com/chromium/src/+/36be3c7a465f00f4edefccc10bba00bbebe1843d%5E%21/

This is complementary to the work Volker Simonis is doing upstream on making `InflaterInputStream` more tolerant of this kind of behavior, providing compatibility for earlier JDK releases.

- https://bugs.openjdk.org/browse/JDK-8281962
- https://bugs.openjdk.org/browse/JDK-8283758

Signed-off-by: Danny Thomas <dannyt@netflix.com>
Copy link
Copy Markdown

@simonis simonis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

Thanks for the downport.

@LloydW93 LloydW93 merged commit 8856740 into cloudflare:gcc.amd64 Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants