diff --git a/apache-tomcat-9.0.31-src.tar.gz b/apache-tomcat-9.0.31-src.tar.gz deleted file mode 100644 index e0b4c81..0000000 --- a/apache-tomcat-9.0.31-src.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4de10d690d8494efc551cb5de2fd5cdec1cda7ef387e9bc2d07ba834b91df3bc -size 5812430 diff --git a/apache-tomcat-9.0.31-src.tar.gz.asc b/apache-tomcat-9.0.31-src.tar.gz.asc deleted file mode 100644 index eedbb86..0000000 --- a/apache-tomcat-9.0.31-src.tar.gz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCAAdFiEEqcXfTSLpmZjZh1pREMAcWi9gWecFAl47GtQACgkQEMAcWi9g -Wef+Kw/7BpH09+833RrzoTqc46HkfM9/FEMJWMwcAFVhZMeRcafCL1aFSwUt75jB -Ua3fErCpJAdXjSoKvINFuPPkXmgTw0HHBSqE8WZKd8Ar+ZUMzhW/cuy+5HUa4J2f -bIsz+eoqm/SCYKC1724XwXqiD/aCTvI0dYBTq1i3um0C1ZH02EW9idxTNIbeaSa0 -zZ95CK42m1ofodwH+pdkSVSHJ838ei4L3/ggAd+T0Xg35MaZJc5wy/hE279uZDcV -WBjAxF/JF8IRl3+5rumf9/xFAumphOJyTZlr4Zhi0NdVmt6Ktz+0SNkobgVRMjcv -izm/vXxK/wkpVVPkCw+Kk9gvsZL13b9TPEf37uTtDaavN9o3ENSQxuhLOZsRooUx -ZpwQBXC+P6zXp8N+HopHPsQpVPpxMGr5Mo8lBYov6QgmYwmbvBmCfjQcvk7X5h8r -MnDkdaqcQ8l4bSiF8h4Sm1lM88DXE+LW8UAW7/ANLfW00ATLZldzdPohHBOSxp0b -/VCnhZHw7UNPHNAdWvNgkRY3nHUiuFkJTsqWO06l1ARCLfuRb5bv+MBcKMPGROpI -fMTgJYBkAOpPq4gZd65aV9BkAPmFd6LZCRfwLEK75NUfeQWCrwMq68OFv5DKEClK -TzPRafdII7oN9ODG6KZfcwoVb1wJclMvHiMMJ5JP02nnGFiEPMk= -=29Ie ------END PGP SIGNATURE----- diff --git a/apache-tomcat-9.0.33-src.tar.gz b/apache-tomcat-9.0.33-src.tar.gz new file mode 100644 index 0000000..8fc04ad --- /dev/null +++ b/apache-tomcat-9.0.33-src.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3c3e6eff772d3a5604418331402cf7c7fc908d5db4f1cb99754206306da9e07 +size 5831264 diff --git a/apache-tomcat-9.0.33-src.tar.gz.asc b/apache-tomcat-9.0.33-src.tar.gz.asc new file mode 100644 index 0000000..b640b40 --- /dev/null +++ b/apache-tomcat-9.0.33-src.tar.gz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEqcXfTSLpmZjZh1pREMAcWi9gWecFAl5osqIACgkQEMAcWi9g +WedOQw/8Df5iDTellH4OkB1TD6YXJ2638BZItvCT6Zx61XKGsXU0qDfDByTQvMVo +EG+wHghWWQ2EGSRTptMimbscKDbF9wu7QmY2a3sD8Z/HSYp2Ov+PCxECklzXBiP0 +HsMQlOkCccnhemvrTHEzU4+rYYFbAaZB2A8UPEvzffEMepE6S/oKu0I6X/APcAmP +kzpWV59RJH+lpV3gLMo9D51L+KzHDOLE2FztBcaBSGfR5b2fxn4g5f4Sv/iW78ZS +vGJObV7t9O3ewpdgfsGyYaoe1BRm1EmMHf/0Fh7DJHXxOjAHVkjeS2fZsvabTwYK +R/pIzOR0Q/jsTE2hulBmKTCjha5ygcYBJ16GLGot9a9KNps1CJ10jsooakYk3z+D +H9JJSDU/H+tcLgIE5MSoJyvkoM1wYH5us7BjbpaRVoOBmhv0ejnlBzoq8YLDlC1S +ThYtsBvS8FohcoeKJIK6IiuvvUu0c0yqmLCOooO58MwYBi5wdbNQvMvn3P/kwY/2 +1sGQPr632sUb47CvP2qJFFkVyLhX8dhDSfNO1rLLoqIlD5xX+Fpu8Vo9njbLZrYu +YSQl94I+u9McQQcOBOFvZnzT53Pbol0k0joXXT1sSdeFgwJT7Og3WgQYDBNC9cuZ +P51tiL6xzDxmeZko3xB62DtHli3QL7dKOit1l80RJKcgwpRixiY= +=f+IL +-----END PGP SIGNATURE----- diff --git a/tomcat-9.0-javadoc.patch b/tomcat-9.0-javadoc.patch index a2c1e1c..282ec20 100644 --- a/tomcat-9.0-javadoc.patch +++ b/tomcat-9.0-javadoc.patch @@ -1,6 +1,8 @@ ---- apache-tomcat-9.0.27-src/build.xml 2019-10-07 12:01:06.000000000 +0200 -+++ apache-tomcat-9.0.27-src/build.xml 2019-11-16 00:52:57.833495494 +0100 -@@ -1859,7 +1859,7 @@ +Index: apache-tomcat-9.0.33-src/build.xml +=================================================================== +--- apache-tomcat-9.0.33-src.orig/build.xml ++++ apache-tomcat-9.0.33-src/build.xml +@@ -1891,7 +1891,7 @@ Apache Tomcat ${version} native binaries source="${compile.source}" maxmemory="512m" failonerror="true" @@ -9,7 +11,7 @@ -@@ -1881,7 +1881,7 @@ +@@ -1913,7 +1913,7 @@ Apache Tomcat ${version} native binaries source="${compile.source}" maxmemory="512m" failonerror="true" @@ -18,7 +20,7 @@ -@@ -1902,7 +1902,7 @@ +@@ -1934,7 +1934,7 @@ Apache Tomcat ${version} native binaries source="${compile.source}" maxmemory="512m" failonerror="true" @@ -27,7 +29,7 @@ -@@ -1923,7 +1923,7 @@ +@@ -1955,7 +1955,7 @@ Apache Tomcat ${version} native binaries source="${compile.source}" maxmemory="512m" failonerror="true" @@ -36,7 +38,7 @@ -@@ -1944,7 +1944,7 @@ +@@ -1976,7 +1976,7 @@ Apache Tomcat ${version} native binaries source="${compile.source}" maxmemory="512m" failonerror="true" @@ -45,7 +47,7 @@ -@@ -1962,9 +1962,10 @@ +@@ -1994,9 +1994,10 @@ Apache Tomcat ${version} native binaries docencoding="UTF-8" charset="UTF-8" additionalparam="-breakiterator -notimestamp" @@ -57,7 +59,7 @@ -@@ -1984,7 +1985,7 @@ +@@ -2016,7 +2017,7 @@ Apache Tomcat ${version} native binaries source="${compile.source}" maxmemory="512m" failonerror="true" @@ -66,7 +68,7 @@ -@@ -1995,8 +1996,6 @@ +@@ -2027,8 +2028,6 @@ Apache Tomcat ${version} native binaries diff --git a/tomcat-9.0-osgi-build.patch b/tomcat-9.0-osgi-build.patch index 8694f5c..60f9fb9 100644 --- a/tomcat-9.0-osgi-build.patch +++ b/tomcat-9.0-osgi-build.patch @@ -1,8 +1,8 @@ -Index: apache-tomcat-9.0.12-src/build.xml +Index: apache-tomcat-9.0.33-src/build.xml =================================================================== ---- apache-tomcat-9.0.12-src.orig/build.xml -+++ apache-tomcat-9.0.12-src/build.xml -@@ -2989,6 +2989,9 @@ Read the Building page on the Apache Tom +--- apache-tomcat-9.0.33-src.orig/build.xml ++++ apache-tomcat-9.0.33-src/build.xml +@@ -3316,6 +3316,9 @@ Read the Building page on the Apache Tom diff --git a/tomcat-9.0.31-java8compat.patch b/tomcat-9.0.31-java8compat.patch index 754571c..45e9685 100644 --- a/tomcat-9.0.31-java8compat.patch +++ b/tomcat-9.0.31-java8compat.patch @@ -1,6 +1,8 @@ ---- apache-tomcat-9.0.31-src/java/org/apache/catalina/connector/InputBuffer.java 2020-02-05 20:42:16.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/catalina/connector/InputBuffer.java 2020-02-25 14:10:19.650974252 +0100 -@@ -389,10 +389,10 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/catalina/connector/InputBuffer.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/catalina/connector/InputBuffer.java ++++ apache-tomcat-9.0.33-src/java/org/apache/catalina/connector/InputBuffer.java +@@ -389,10 +389,10 @@ public class InputBuffer extends Reader } int n = Math.min(to.remaining(), bb.remaining()); int orgLimit = bb.limit(); @@ -14,7 +16,7 @@ return n; } -@@ -488,11 +488,11 @@ +@@ -488,11 +488,11 @@ public class InputBuffer extends Reader long nRead = 0; while (nRead < n) { if (cb.remaining() >= n) { @@ -28,7 +30,7 @@ int nb = realReadChars(); if (nb < 0) { break; -@@ -533,7 +533,7 @@ +@@ -533,7 +533,7 @@ public class InputBuffer extends Reader } else { if ((cb.capacity() > (2 * size)) && (cb.remaining()) < (cb.position())) { cb.compact(); @@ -37,7 +39,7 @@ } } readLimit = cb.position() + readAheadLimit + size; -@@ -554,7 +554,7 @@ +@@ -554,7 +554,7 @@ public class InputBuffer extends Reader markPos = -1; throw new IOException(); } else { @@ -46,7 +48,7 @@ } } else { clear(bb); -@@ -672,10 +672,10 @@ +@@ -672,10 +672,10 @@ public class InputBuffer extends Reader CharBuffer tmp = CharBuffer.allocate(newSize); int oldPosition = cb.position(); @@ -60,9 +62,11 @@ cb = tmp; tmp = null; } ---- apache-tomcat-9.0.31-src/java/org/apache/catalina/connector/OutputBuffer.java 2020-02-05 20:42:16.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/catalina/connector/OutputBuffer.java 2020-02-25 14:10:19.662974317 +0100 -@@ -761,10 +761,10 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/catalina/connector/OutputBuffer.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/catalina/connector/OutputBuffer.java ++++ apache-tomcat-9.0.33-src/java/org/apache/catalina/connector/OutputBuffer.java +@@ -761,10 +761,10 @@ public class OutputBuffer extends Writer int limit = bb.capacity(); int fromLimit = from.limit(); while (from.remaining() >= limit) { @@ -76,8 +80,10 @@ } if (from.remaining() > 0) { ---- apache-tomcat-9.0.31-src/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java 2020-02-05 20:42:27.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java 2020-02-25 14:10:19.662974317 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java ++++ apache-tomcat-9.0.33-src/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java @@ -18,6 +18,7 @@ package org.apache.catalina.tribes.transport.nio; import java.io.IOException; @@ -86,7 +92,7 @@ import java.nio.ByteBuffer; import java.nio.channels.CancelledKeyException; import java.nio.channels.DatagramChannel; -@@ -80,7 +81,7 @@ +@@ -80,7 +81,7 @@ public class NioReplicationTask extends buffer = ByteBuffer.allocate(size); } } else { @@ -95,7 +101,7 @@ } if (key == null) { return; // just in case -@@ -156,30 +157,30 @@ +@@ -156,30 +157,30 @@ public class NioReplicationTask extends reader.access(); ReadableByteChannel channel = (ReadableByteChannel) key.channel(); int count=-1; @@ -131,9 +137,11 @@ //did we get a package count = reader.hasPackage()?1:-1; } ---- apache-tomcat-9.0.31-src/java/org/apache/catalina/tribes/transport/nio/NioSender.java 2020-02-05 20:42:27.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/catalina/tribes/transport/nio/NioSender.java 2020-02-25 14:10:19.662974317 +0100 -@@ -20,6 +20,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/catalina/tribes/transport/nio/NioSender.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/catalina/tribes/transport/nio/NioSender.java ++++ apache-tomcat-9.0.33-src/java/org/apache/catalina/tribes/transport/nio/NioSender.java +@@ -20,6 +20,7 @@ package org.apache.catalina.tribes.trans import java.io.EOFException; import java.io.IOException; import java.net.InetSocketAddress; @@ -141,7 +149,7 @@ import java.nio.ByteBuffer; import java.nio.channels.DatagramChannel; import java.nio.channels.SelectionKey; -@@ -173,9 +174,9 @@ +@@ -173,9 +174,9 @@ public class NioSender extends AbstractS if ( read == -1 ) throw new IOException(sm.getString("nioSender.unable.receive.ack")); //no data read else if ( read == 0 ) return false; @@ -153,7 +161,7 @@ if (ackbuf.doesPackageExist() ) { byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes(); boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA); -@@ -225,12 +226,12 @@ +@@ -225,12 +226,12 @@ public class NioSender extends AbstractS if ( readbuf == null ) { readbuf = getReadBuffer(); } else { @@ -168,7 +176,7 @@ } if (isUdpBased()) { -@@ -317,8 +318,8 @@ +@@ -317,8 +318,8 @@ public class NioSender extends AbstractS if ( isConnected() && readbuf == null) { readbuf = getReadBuffer(); } @@ -179,7 +187,7 @@ current = null; ackbuf.clear(); remaining = 0; -@@ -357,7 +358,7 @@ +@@ -357,7 +358,7 @@ public class NioSender extends AbstractS remaining = length; ackbuf.clear(); if (writebuf != null) { @@ -188,7 +196,7 @@ } else { writebuf = getBuffer(length); } -@@ -367,7 +368,7 @@ +@@ -367,7 +368,7 @@ public class NioSender extends AbstractS // TODO use ByteBuffer.wrap to avoid copying the data. writebuf.put(data,offset,length); @@ -197,9 +205,11 @@ if (isConnected()) { if (isUdpBased()) dataChannel.register(getSelector(), SelectionKey.OP_WRITE, this); ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/ajp/AjpProcessor.java 2020-02-05 20:42:31.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/ajp/AjpProcessor.java 2020-02-25 14:10:19.662974317 +0100 -@@ -21,6 +21,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/ajp/AjpProcessor.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/ajp/AjpProcessor.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/ajp/AjpProcessor.java +@@ -21,6 +21,7 @@ import java.io.EOFException; import java.io.IOException; import java.io.InterruptedIOException; import java.net.InetAddress; @@ -207,7 +217,7 @@ import java.nio.ByteBuffer; import java.security.NoSuchProviderException; import java.security.cert.CertificateFactory; -@@ -1240,7 +1241,7 @@ +@@ -1260,7 +1261,7 @@ public class AjpProcessor extends Abstra responseMessage.reset(); responseMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK); @@ -216,8 +226,10 @@ responseMessage.appendBytes(chunk); responseMessage.end(); socketWrapper.write(blocking, responseMessage.getBuffer(), 0, responseMessage.getLen()); ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/BufferedInputFilter.java 2020-02-05 20:42:31.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/BufferedInputFilter.java 2020-02-25 14:10:19.662974317 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/BufferedInputFilter.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http11/filters/BufferedInputFilter.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/BufferedInputFilter.java @@ -18,6 +18,7 @@ package org.apache.coyote.http11.filters; @@ -226,7 +238,7 @@ import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -@@ -68,7 +69,7 @@ +@@ -68,7 +69,7 @@ public class BufferedInputFilter impleme public void setLimit(int limit) { if (buffered == null) { buffered = ByteBuffer.allocate(limit); @@ -235,7 +247,7 @@ } } -@@ -84,9 +85,9 @@ +@@ -84,9 +85,9 @@ public class BufferedInputFilter impleme // save off the Request body try { while (buffer.doRead(this) >= 0) { @@ -247,7 +259,7 @@ tempRead = null; } } catch(IOException | BufferOverflowException ioe) { -@@ -121,7 +122,7 @@ +@@ -121,7 +122,7 @@ public class BufferedInputFilter impleme if (buffered.capacity() > 65536) { buffered = null; } else { @@ -256,9 +268,11 @@ } } hasRead = false; ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2020-02-05 20:42:31.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java 2020-02-25 14:10:19.662974317 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java +@@ -18,6 +18,7 @@ package org.apache.coyote.http11.filters import java.io.EOFException; import java.io.IOException; @@ -266,7 +280,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Locale; -@@ -184,14 +185,14 @@ +@@ -184,14 +185,14 @@ public class ChunkedInputFilter implemen if (readChunk != handler.getByteBuffer()) { handler.setByteBuffer(readChunk.duplicate()); } @@ -283,7 +297,7 @@ remaining = 0; //we need a CRLF if ((readChunk.position() + 1) >= readChunk.limit()) { -@@ -263,7 +264,7 @@ +@@ -263,7 +264,7 @@ public class ChunkedInputFilter implemen public void recycle() { remaining = 0; if (readChunk != null) { @@ -292,7 +306,7 @@ } endChunk = false; needCRLFParse = false; -@@ -363,7 +364,7 @@ +@@ -363,7 +364,7 @@ public class ChunkedInputFilter implemen // Parsing the CRLF increments pos if (!eol) { @@ -301,7 +315,7 @@ } } -@@ -415,7 +416,7 @@ +@@ -415,7 +416,7 @@ public class ChunkedInputFilter implemen throwIOException(sm.getString("chunkedInputFilter.invalidCrlf")); } @@ -310,7 +324,7 @@ } } -@@ -484,7 +485,7 @@ +@@ -484,7 +485,7 @@ public class ChunkedInputFilter implemen trailingHeaders.append(chr); } @@ -319,7 +333,7 @@ } int colonPos = trailingHeaders.getEnd(); -@@ -513,7 +514,7 @@ +@@ -513,7 +514,7 @@ public class ChunkedInputFilter implemen chr = readChunk.get(readChunk.position()); if ((chr == Constants.SP) || (chr == Constants.HT)) { @@ -328,7 +342,7 @@ // If we swallow whitespace, make sure it counts towards the // limit placed on trailing header size int newlimit = trailingHeaders.getLimit() -1; -@@ -549,7 +550,7 @@ +@@ -549,7 +550,7 @@ public class ChunkedInputFilter implemen } if (!eol) { @@ -337,9 +351,11 @@ } } ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java 2020-02-05 20:42:31.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java 2020-02-25 14:10:19.662974317 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/ChunkedOutputFilter.java +@@ -18,6 +18,7 @@ package org.apache.coyote.http11.filters import java.io.IOException; import java.io.OutputStreamWriter; @@ -347,7 +363,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.HashSet; -@@ -106,12 +107,12 @@ +@@ -106,12 +107,12 @@ public class ChunkedOutputFilter impleme int pos = calculateChunkHeader(result); @@ -362,7 +378,7 @@ buffer.doWrite(chunkHeader); return result; -@@ -171,10 +172,10 @@ +@@ -171,10 +172,10 @@ public class ChunkedOutputFilter impleme if (trailerFields == null) { // Write end chunk buffer.doWrite(endChunk); @@ -375,7 +391,7 @@ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); OutputStreamWriter osw = new OutputStreamWriter(baos, StandardCharsets.ISO_8859_1); -@@ -194,7 +195,7 @@ +@@ -194,7 +195,7 @@ public class ChunkedOutputFilter impleme buffer.doWrite(ByteBuffer.wrap(baos.toByteArray())); buffer.doWrite(crlfChunk); @@ -384,8 +400,10 @@ } buffer.end(); } ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/IdentityInputFilter.java 2020-02-05 20:42:31.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/IdentityInputFilter.java 2020-02-25 14:10:19.662974317 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/IdentityInputFilter.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http11/filters/IdentityInputFilter.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/IdentityInputFilter.java @@ -18,6 +18,7 @@ package org.apache.coyote.http11.filters; @@ -394,7 +412,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -@@ -104,7 +105,7 @@ +@@ -104,7 +105,7 @@ public class IdentityInputFilter impleme // The chunk is longer than the number of bytes remaining // in the body; changing the chunk length to the number // of bytes remaining @@ -403,7 +421,7 @@ result = (int) remaining; } else { result = nRead; -@@ -116,7 +117,7 @@ +@@ -116,7 +117,7 @@ public class IdentityInputFilter impleme // No more bytes left to be read : return -1 and clear the // buffer if (handler.getByteBuffer() != null) { @@ -412,8 +430,10 @@ } result = -1; } ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java 2020-02-05 20:42:31.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java 2020-02-25 14:10:19.662974317 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/IdentityOutputFilter.java @@ -17,6 +17,7 @@ package org.apache.coyote.http11.filters; @@ -422,7 +442,7 @@ import java.nio.ByteBuffer; import org.apache.coyote.Response; -@@ -64,7 +65,7 @@ +@@ -64,7 +65,7 @@ public class IdentityOutputFilter implem // The chunk is longer than the number of bytes remaining // in the body; changing the chunk length to the number // of bytes remaining @@ -431,7 +451,7 @@ result = (int) remaining; remaining = 0; } else { -@@ -74,8 +75,8 @@ +@@ -74,8 +75,8 @@ public class IdentityOutputFilter implem } else { // No more bytes left to be written : return -1 and clear the // buffer @@ -442,8 +462,10 @@ result = -1; } } else { ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java 2020-02-05 20:42:31.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java 2020-02-25 14:10:19.666974339 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java @@ -18,6 +18,7 @@ package org.apache.coyote.http11.filters; @@ -452,7 +474,7 @@ import java.nio.ByteBuffer; import org.apache.coyote.InputBuffer; -@@ -51,7 +52,7 @@ +@@ -51,7 +52,7 @@ public class SavedRequestInputFilter imp return -1; ByteBuffer byteBuffer = handler.getByteBuffer(); @@ -461,9 +483,11 @@ input.subtract(byteBuffer); return byteBuffer.remaining(); ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/Http11InputBuffer.java 2020-02-05 20:42:31.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/Http11InputBuffer.java 2020-02-25 14:17:38.009341456 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/Http11InputBuffer.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http11/Http11InputBuffer.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/Http11InputBuffer.java +@@ -18,6 +18,7 @@ package org.apache.coyote.http11; import java.io.EOFException; import java.io.IOException; @@ -471,7 +495,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Arrays; -@@ -263,7 +264,7 @@ +@@ -265,7 +266,7 @@ public class Http11InputBuffer implement activeFilters[i].recycle(); } @@ -480,7 +504,7 @@ lastActiveFilter = -1; parsingHeader = true; swallowInput = true; -@@ -291,10 +292,10 @@ +@@ -295,10 +296,10 @@ public class Http11InputBuffer implement if (byteBuffer.remaining() > 0) { // Copy leftover bytes to the beginning of the buffer byteBuffer.compact(); @@ -493,7 +517,7 @@ } } -@@ -380,7 +381,7 @@ +@@ -382,7 +383,7 @@ public class Http11InputBuffer implement } chr = byteBuffer.get(); } while ((chr == Constants.CR) || (chr == Constants.LF)); @@ -502,7 +526,7 @@ parsingRequestLineStart = byteBuffer.position(); parsingRequestLinePhase = 2; -@@ -410,7 +411,7 @@ +@@ -412,7 +413,7 @@ public class Http11InputBuffer implement request.method().setBytes(byteBuffer.array(), parsingRequestLineStart, pos - parsingRequestLineStart); } else if (!HttpParser.isToken(chr)) { @@ -511,7 +535,7 @@ // Avoid unknown protocol triggering an additional error request.protocol().setString(Constants.HTTP_11); throw new IllegalArgumentException(sm.getString("iib.invalidmethod")); -@@ -430,7 +431,7 @@ +@@ -520,7 +521,7 @@ public class Http11InputBuffer implement byte chr = byteBuffer.get(); if (!(chr == Constants.SP || chr == Constants.HT)) { space = false; @@ -520,16 +544,7 @@ } } parsingRequestLineStart = byteBuffer.position(); -@@ -499,7 +500,7 @@ - byte chr = byteBuffer.get(); - if (!(chr == Constants.SP || chr == Constants.HT)) { - space = false; -- byteBuffer.position(byteBuffer.position() - 1); -+ ((Buffer)byteBuffer).position(byteBuffer.position() - 1); - } - } - parsingRequestLineStart = byteBuffer.position(); -@@ -599,7 +600,7 @@ +@@ -618,7 +619,7 @@ public class Http11InputBuffer implement if (swallowInput && (lastActiveFilter != -1)) { int extraBytes = (int) activeFilters[lastActiveFilter].end(); @@ -538,7 +553,7 @@ } } -@@ -697,7 +698,7 @@ +@@ -716,7 +717,7 @@ public class Http11InputBuffer implement wrapper.getSocketBufferHandler().getReadBuffer().capacity(); if (byteBuffer == null || byteBuffer.capacity() < bufLength) { byteBuffer = ByteBuffer.allocate(bufLength); @@ -547,7 +562,7 @@ } } -@@ -722,14 +723,14 @@ +@@ -741,14 +742,14 @@ public class Http11InputBuffer implement throw new IllegalArgumentException(sm.getString("iib.requestheadertoolarge.error")); } } else { @@ -566,7 +581,7 @@ SocketWrapperBase socketWrapper = this.wrapper; int nRead = -1; if (socketWrapper != null) { -@@ -737,7 +738,7 @@ +@@ -756,7 +757,7 @@ public class Http11InputBuffer implement } else { throw new CloseNowException(sm.getString("iib.eof.error")); } @@ -575,20 +590,20 @@ if (nRead > 0) { return true; } else if (nRead == -1) { -@@ -784,10 +785,10 @@ +@@ -796,10 +797,10 @@ public class Http11InputBuffer implement } else { - if (prevChr == 0) { - // Must have only read one byte -- byteBuffer.position(byteBuffer.position() - 1); -+ ((Buffer)byteBuffer).position(byteBuffer.position() - 1); - } else { + if (prevChr == Constants.CR) { // Must have read two bytes (first was CR, second was not LF) - byteBuffer.position(byteBuffer.position() - 2); + ((Buffer)byteBuffer).position(byteBuffer.position() - 2); + } else { + // Must have only read one byte +- byteBuffer.position(byteBuffer.position() - 1); ++ ((Buffer)byteBuffer).position(byteBuffer.position() - 1); } break; } -@@ -830,7 +831,7 @@ +@@ -842,7 +843,7 @@ public class Http11InputBuffer implement // Non-token characters are illegal in header names // Parsing continues so the error can be reported in context headerData.lastSignificantChar = pos; @@ -597,7 +612,7 @@ // skipLine() will handle the error return skipLine(); } -@@ -868,7 +869,7 @@ +@@ -880,7 +881,7 @@ public class Http11InputBuffer implement chr = byteBuffer.get(); if (!(chr == Constants.SP || chr == Constants.HT)) { headerParsePos = HeaderParsePosition.HEADER_VALUE; @@ -606,7 +621,7 @@ break; } } -@@ -1102,7 +1103,7 @@ +@@ -1111,7 +1112,7 @@ public class Http11InputBuffer implement int length = byteBuffer.remaining(); handler.setByteBuffer(byteBuffer.duplicate()); @@ -615,7 +630,7 @@ return length; } -@@ -1124,12 +1125,12 @@ +@@ -1133,12 +1134,12 @@ public class Http11InputBuffer implement @Override public void expand(int size) { if (byteBuffer.capacity() >= size) { @@ -630,8 +645,10 @@ temp = null; } } ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/Http11OutputBuffer.java 2020-02-05 20:42:31.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http11/Http11OutputBuffer.java 2020-02-25 14:10:19.666974339 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/Http11OutputBuffer.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http11/Http11OutputBuffer.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http11/Http11OutputBuffer.java @@ -17,6 +17,7 @@ package org.apache.coyote.http11; @@ -640,7 +657,7 @@ import java.nio.ByteBuffer; import java.util.Arrays; -@@ -242,7 +243,7 @@ +@@ -242,7 +243,7 @@ public class Http11OutputBuffer implemen * headers so the error response can be written. */ void resetHeaderBuffer() { @@ -649,7 +666,7 @@ } -@@ -270,7 +271,7 @@ +@@ -270,7 +271,7 @@ public class Http11OutputBuffer implemen // Recycle response object response.recycle(); // Reset pointers @@ -658,7 +675,7 @@ lastActiveFilter = -1; responseFinished = false; byteCount = 0; -@@ -302,7 +303,7 @@ +@@ -302,7 +303,7 @@ public class Http11OutputBuffer implemen if (headerBuffer.position() > 0) { // Sending the response header buffer @@ -667,7 +684,7 @@ try { SocketWrapperBase socketWrapper = this.socketWrapper; if (socketWrapper != null) { -@@ -311,7 +312,7 @@ +@@ -311,7 +312,7 @@ public class Http11OutputBuffer implemen throw new CloseNowException(sm.getString("iob.failedwrite")); } } finally { @@ -676,8 +693,10 @@ } } } ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/HpackDecoder.java 2020-02-05 20:42:32.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/HpackDecoder.java 2020-02-25 14:10:19.666974339 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/HpackDecoder.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http2/HpackDecoder.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/HpackDecoder.java @@ -16,6 +16,7 @@ */ package org.apache.coyote.http2; @@ -686,7 +705,7 @@ import java.nio.ByteBuffer; import org.apache.tomcat.util.res.StringManager; -@@ -99,10 +100,10 @@ +@@ -99,10 +100,10 @@ public class HpackDecoder { byte b = buffer.get(); if ((b & 0b10000000) != 0) { //if the first bit is set it is an indexed header field @@ -699,7 +718,7 @@ return; } else if(index == 0) { throw new HpackException( -@@ -113,12 +114,12 @@ +@@ -113,12 +114,12 @@ public class HpackDecoder { //Literal Header Field with Incremental Indexing String headerName = readHeaderName(buffer, 6); if (headerName == null) { @@ -714,7 +733,7 @@ return; } emitHeader(headerName, headerValue); -@@ -127,12 +128,12 @@ +@@ -127,12 +128,12 @@ public class HpackDecoder { //Literal Header Field without Indexing String headerName = readHeaderName(buffer, 4); if (headerName == null) { @@ -729,7 +748,7 @@ return; } emitHeader(headerName, headerValue); -@@ -140,12 +141,12 @@ +@@ -140,12 +141,12 @@ public class HpackDecoder { //Literal Header Field never indexed String headerName = readHeaderName(buffer, 4); if (headerName == null) { @@ -744,7 +763,7 @@ return; } emitHeader(headerName, headerValue); -@@ -164,10 +165,10 @@ +@@ -164,10 +165,10 @@ public class HpackDecoder { if (headerCount != 0) { throw new HpackException(sm.getString("hpackdecoder.tableSizeUpdateNotAtStart")); } @@ -757,7 +776,7 @@ return false; } if (size > maxMemorySizeHard) { -@@ -197,7 +198,7 @@ +@@ -197,7 +198,7 @@ public class HpackDecoder { } private String readHeaderName(ByteBuffer buffer, int prefixLength) throws HpackException { @@ -766,8 +785,10 @@ int index = Hpack.decodeInteger(buffer, prefixLength); if (index == -1) { return null; ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/HPackHuffman.java 2020-02-05 20:42:32.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/HPackHuffman.java 2020-02-25 14:10:19.666974339 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/HPackHuffman.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http2/HPackHuffman.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/HPackHuffman.java @@ -16,6 +16,7 @@ */ package org.apache.coyote.http2; @@ -776,7 +797,7 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.HashSet; -@@ -483,7 +484,7 @@ +@@ -483,7 +484,7 @@ public class HPackHuffman { int rem = code.length; while (rem > 0) { if (!buffer.hasRemaining()) { @@ -785,7 +806,7 @@ return false; } int remainingInByte = 8 - bytePos; -@@ -504,7 +505,7 @@ +@@ -504,7 +505,7 @@ public class HPackHuffman { } if (bytePos == 8) { if (!buffer.hasRemaining()) { @@ -794,7 +815,7 @@ return false; } buffer.put(currentBufferByte); -@@ -514,14 +515,14 @@ +@@ -514,14 +515,14 @@ public class HPackHuffman { if (buffer.position() - start > toEncode.length()) { //the encoded version is longer than the original //just return false @@ -811,8 +832,10 @@ return false; } buffer.put((byte) (currentBufferByte | ((0xFF) >> bytePos))); ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Hpack.java 2020-02-05 20:42:32.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Hpack.java 2020-02-25 14:10:19.666974339 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Hpack.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http2/Hpack.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Hpack.java @@ -16,6 +16,7 @@ */ package org.apache.coyote.http2; @@ -821,7 +844,7 @@ import java.nio.ByteBuffer; import org.apache.tomcat.util.res.StringManager; -@@ -165,7 +166,7 @@ +@@ -165,7 +166,7 @@ final class Hpack { if (source.remaining() == 0) { //we have run out of data //reset @@ -830,8 +853,10 @@ return -1; } b = source.get(); ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Http2AsyncParser.java 2020-02-05 20:42:32.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Http2AsyncParser.java 2020-02-25 14:10:19.666974339 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Http2AsyncParser.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http2/Http2AsyncParser.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Http2AsyncParser.java @@ -17,6 +17,7 @@ package org.apache.coyote.http2; @@ -840,7 +865,7 @@ import java.nio.ByteBuffer; import java.nio.channels.CompletionHandler; import java.util.concurrent.TimeUnit; -@@ -103,7 +104,7 @@ +@@ -103,7 +104,7 @@ class Http2AsyncParser extends Http2Pars public void completed(Long result, Void attachment) { if (streamException || error == null) { ByteBuffer payload = buffers[2]; @@ -849,7 +874,7 @@ try { if (streamException) { swallow(streamId, payloadSize, false, payload); -@@ -232,7 +233,7 @@ +@@ -232,7 +233,7 @@ class Http2AsyncParser extends Http2Pars public void completed(Long result, Void attachment) { if (streamException || error == null) { ByteBuffer payload = buffers[1]; @@ -858,7 +883,7 @@ try { boolean continueParsing; do { -@@ -286,7 +287,7 @@ +@@ -286,7 +287,7 @@ class Http2AsyncParser extends Http2Pars if (payload.remaining() - 9 >= payloadSize) { continueParsing = true; // Now go over frame header @@ -867,8 +892,10 @@ try { validateFrame(null, frameType, streamId, flags, payloadSize); } catch (StreamException e) { ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java 2020-02-05 20:42:32.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java 2020-02-25 14:10:19.666974339 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Http2AsyncUpgradeHandler.java @@ -17,6 +17,7 @@ package org.apache.coyote.http2; @@ -877,7 +904,7 @@ import java.nio.ByteBuffer; import java.nio.channels.CompletionHandler; import java.nio.channels.FileChannel; -@@ -216,11 +217,11 @@ +@@ -216,11 +217,11 @@ public class Http2AsyncUpgradeHandler ex if (writeable) { ByteUtil.set31Bits(header, 5, stream.getIdAsInt()); int orgLimit = data.limit(); @@ -891,8 +918,10 @@ handleAsyncException(); } } ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Http2Parser.java 2020-02-05 20:42:32.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Http2Parser.java 2020-02-25 14:10:19.666974339 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Http2Parser.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http2/Http2Parser.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Http2Parser.java @@ -17,6 +17,7 @@ package org.apache.coyote.http2; @@ -901,7 +930,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -@@ -192,9 +193,9 @@ +@@ -192,9 +193,9 @@ class Http2Parser { input.fill(true, dest, dataLength); } else { int oldLimit = buffer.limit(); @@ -913,7 +942,7 @@ } // Process padding before sending any notifications in case // padding is invalid. -@@ -475,12 +476,12 @@ +@@ -475,12 +476,12 @@ class Http2Parser { input.fill(true, headerReadBuffer, toRead); } else { int oldLimit = buffer.limit(); @@ -929,7 +958,7 @@ try { hpackDecoder.decode(headerReadBuffer); } catch (HpackException hpe) { -@@ -550,7 +551,7 @@ +@@ -550,7 +551,7 @@ class Http2Parser { return; } if (!mustBeZero && byteBuffer != null) { @@ -938,7 +967,7 @@ } else { int read = 0; byte[] buffer = new byte[1024]; -@@ -710,7 +711,7 @@ +@@ -710,7 +711,7 @@ class Http2Parser { default boolean fill(boolean block, ByteBuffer data, int len) throws IOException { boolean result = fill(block, data.array(), data.arrayOffset() + data.position(), len); if (result) { @@ -947,9 +976,11 @@ } return result; } ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Http2UpgradeHandler.java 2020-02-05 20:42:32.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Http2UpgradeHandler.java 2020-02-25 14:10:19.670974359 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Http2UpgradeHandler.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http2/Http2UpgradeHandler.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Http2UpgradeHandler.java +@@ -18,6 +18,7 @@ package org.apache.coyote.http2; import java.io.EOFException; import java.io.IOException; @@ -957,7 +988,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.HashSet; -@@ -762,9 +763,9 @@ +@@ -762,9 +763,9 @@ class Http2UpgradeHandler extends Abstra try { socketWrapper.write(true, header, 0, header.length); int orgLimit = data.limit(); @@ -969,7 +1000,7 @@ socketWrapper.flush(true); } catch (IOException ioe) { handleAppInitiatedIOException(ioe); -@@ -1830,7 +1831,7 @@ +@@ -1830,7 +1831,7 @@ class Http2UpgradeHandler extends Abstra } catch (IOException ioe) { handleAppInitiatedIOException(ioe); } @@ -978,8 +1009,10 @@ } @Override ---- apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Stream.java 2020-02-05 20:42:32.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/coyote/http2/Stream.java 2020-02-25 14:10:19.670974359 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Stream.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/coyote/http2/Stream.java ++++ apache-tomcat-9.0.33-src/java/org/apache/coyote/http2/Stream.java @@ -17,6 +17,7 @@ package org.apache.coyote.http2; @@ -988,7 +1021,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.security.AccessController; -@@ -850,9 +851,9 @@ +@@ -850,9 +851,9 @@ class Stream extends AbstractStream impl int chunkLimit = chunk.limit(); while (chunk.remaining() > 0) { int thisTime = Math.min(buffer.remaining(), chunk.remaining()); @@ -1000,7 +1033,7 @@ if (chunk.remaining() > 0 && !buffer.hasRemaining()) { // Only flush if we have more data to write and the buffer // is full -@@ -922,7 +923,7 @@ +@@ -922,7 +923,7 @@ class Stream extends AbstractStream impl // Buffer is empty. Nothing to do. return false; } @@ -1009,7 +1042,7 @@ int left = buffer.remaining(); while (left > 0) { if (streamReservation == 0) { -@@ -953,7 +954,7 @@ +@@ -953,7 +954,7 @@ class Stream extends AbstractStream impl left -= connectionReservation; } } @@ -1018,7 +1051,7 @@ return false; } -@@ -1014,9 +1015,9 @@ +@@ -1014,9 +1015,9 @@ class Stream extends AbstractStream impl int chunkLimit = src.limit(); while (src.remaining() > 0) { int thisTime = Math.min(buffer.remaining(), src.remaining()); @@ -1030,7 +1063,7 @@ if (flush(false, blocking)) { return true; } -@@ -1104,14 +1105,14 @@ +@@ -1104,14 +1105,14 @@ class Stream extends AbstractStream impl if (inBuffer.position() > 0) { // Data is available in the inBuffer. Copy it to the // outBuffer. @@ -1047,9 +1080,11 @@ } else if (!canRead) { return -1; } else { ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/B2CConverter.java 2020-02-05 20:42:40.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/B2CConverter.java 2020-02-25 14:10:19.670974359 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/B2CConverter.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/buf/B2CConverter.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/B2CConverter.java +@@ -18,6 +18,7 @@ package org.apache.tomcat.util.buf; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -1057,7 +1092,7 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; -@@ -107,7 +108,7 @@ +@@ -107,7 +108,7 @@ public class B2CConverter { */ public void recycle() { decoder.reset(); @@ -1066,7 +1101,7 @@ } /** -@@ -126,8 +127,8 @@ +@@ -126,8 +127,8 @@ public class B2CConverter { bb = ByteBuffer.wrap(bc.getBuffer(), bc.getStart(), bc.getLength()); } else { // Initialize the byte buffer @@ -1077,7 +1112,7 @@ } if ((cb == null) || (cb.array() != cc.getBuffer())) { // Create a new char buffer if anything changed -@@ -135,8 +136,8 @@ +@@ -135,8 +136,8 @@ public class B2CConverter { cc.getBuffer().length - cc.getEnd()); } else { // Initialize the char buffer @@ -1088,7 +1123,7 @@ } CoderResult result = null; // Parse leftover if any are present -@@ -145,16 +146,16 @@ +@@ -145,16 +146,16 @@ public class B2CConverter { // Loop until one char is decoded or there is a decoder error do { leftovers.put(bc.subtractB()); @@ -1110,7 +1145,7 @@ } // Do the decoding and get the results into the byte chunk and the char // chunk -@@ -172,8 +173,8 @@ +@@ -172,8 +173,8 @@ public class B2CConverter { cc.setEnd(cb.position()); // Put leftovers in the leftovers byte buffer if (bc.getLength() > 0) { @@ -1121,7 +1156,7 @@ bc.subtract(leftovers.array(), 0, bc.getLength()); } } -@@ -196,16 +197,16 @@ +@@ -196,16 +197,16 @@ public class B2CConverter { bb = ByteBuffer.wrap(bc.array(), bc.arrayOffset() + bc.position(), bc.remaining()); } else { // Initialize the byte buffer @@ -1142,7 +1177,7 @@ } CoderResult result = null; // Parse leftover if any are present -@@ -221,16 +222,16 @@ +@@ -221,16 +222,16 @@ public class B2CConverter { chr = bc.get(); } leftovers.put(chr); @@ -1164,7 +1199,7 @@ } // Do the decoding and get the results into the byte chunk and the char // chunk -@@ -240,16 +241,16 @@ +@@ -240,16 +241,16 @@ public class B2CConverter { } else if (result.isOverflow()) { // Propagate current positions to the byte chunk and char chunk, if // this continues the char buffer will get resized @@ -1187,8 +1222,10 @@ bc.get(leftovers.array(), 0, bc.remaining()); } } ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/ByteBufferHolder.java 2020-02-05 20:42:40.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/ByteBufferHolder.java 2020-02-25 14:10:19.670974359 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/ByteBufferHolder.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/buf/ByteBufferHolder.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/ByteBufferHolder.java @@ -16,6 +16,7 @@ */ package org.apache.tomcat.util.buf; @@ -1197,7 +1234,7 @@ import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicBoolean; -@@ -46,7 +47,7 @@ +@@ -46,7 +47,7 @@ public class ByteBufferHolder { public boolean flip() { if (flipped.compareAndSet(false, true)) { @@ -1206,9 +1243,11 @@ return true; } else { return false; ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/ByteBufferUtils.java 2020-02-05 20:42:40.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/ByteBufferUtils.java 2020-02-25 14:10:19.670974359 +0100 -@@ -19,6 +19,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/ByteBufferUtils.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/buf/ByteBufferUtils.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/ByteBufferUtils.java +@@ -19,6 +19,7 @@ package org.apache.tomcat.util.buf; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -1216,7 +1255,7 @@ import java.nio.ByteBuffer; import org.apache.juli.logging.Log; -@@ -108,7 +109,7 @@ +@@ -108,7 +109,7 @@ public class ByteBufferUtils { } // Copy data @@ -1225,9 +1264,11 @@ out.put(in); if (direct) { ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/ByteChunk.java 2020-02-05 20:42:40.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/ByteChunk.java 2020-02-25 14:10:19.670974359 +0100 -@@ -19,6 +19,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/ByteChunk.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/buf/ByteChunk.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/ByteChunk.java +@@ -19,6 +19,7 @@ package org.apache.tomcat.util.buf; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; @@ -1235,7 +1276,7 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; -@@ -345,7 +346,7 @@ +@@ -345,7 +346,7 @@ public final class ByteChunk extends Abs // and avoid an extra copy if (len == limit && end == start && out != null) { out.realWriteBytes(from); @@ -1244,7 +1285,7 @@ return; } // if we have limit and we're below -@@ -375,13 +376,13 @@ +@@ -375,13 +376,13 @@ public final class ByteChunk extends Abs int remain = len - avail; avail = limit - end; while (remain >= avail) { @@ -1261,7 +1302,7 @@ from.get(buff, end, remain); end += remain; } -@@ -482,8 +483,8 @@ +@@ -482,8 +483,8 @@ public final class ByteChunk extends Abs } int n = Math.min(to.remaining(), getLength()); to.put(buff, start, n); @@ -1272,8 +1313,10 @@ start += n; return n; } ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/C2BConverter.java 2020-02-05 20:42:41.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/C2BConverter.java 2020-02-25 14:10:19.670974359 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/C2BConverter.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/buf/C2BConverter.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/C2BConverter.java @@ -17,6 +17,7 @@ package org.apache.tomcat.util.buf; @@ -1282,7 +1325,7 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; -@@ -51,7 +52,7 @@ +@@ -51,7 +52,7 @@ public final class C2BConverter { */ public void recycle() { encoder.reset(); @@ -1291,7 +1334,7 @@ } public boolean isUndeflow() { -@@ -71,16 +72,16 @@ +@@ -71,16 +72,16 @@ public final class C2BConverter { bb = ByteBuffer.wrap(bc.getBuffer(), bc.getEnd(), bc.getBuffer().length - bc.getEnd()); } else { // Initialize the byte buffer @@ -1312,7 +1355,7 @@ } CoderResult result = null; // Parse leftover if any are present -@@ -89,16 +90,16 @@ +@@ -89,16 +90,16 @@ public final class C2BConverter { // Loop until one char is encoded or there is a encoder error do { leftovers.put((char) cc.subtract()); @@ -1334,7 +1377,7 @@ } // Do the decoding and get the results into the byte chunk and the char // chunk -@@ -115,8 +116,8 @@ +@@ -115,8 +116,8 @@ public final class C2BConverter { cc.setOffset(cb.position()); // Put leftovers in the leftovers char buffer if (cc.getLength() > 0) { @@ -1345,7 +1388,7 @@ cc.subtract(leftovers.array(), 0, cc.getLength()); } } -@@ -135,16 +136,16 @@ +@@ -135,16 +136,16 @@ public final class C2BConverter { bb = ByteBuffer.wrap(bc.array(), bc.limit(), bc.capacity() - bc.limit()); } else { // Initialize the byte buffer @@ -1366,7 +1409,7 @@ } CoderResult result = null; // Parse leftover if any are present -@@ -153,16 +154,16 @@ +@@ -153,16 +154,16 @@ public final class C2BConverter { // Loop until one char is encoded or there is a encoder error do { leftovers.put(cc.get()); @@ -1388,7 +1431,7 @@ } // Do the decoding and get the results into the byte chunk and the char // chunk -@@ -171,16 +172,16 @@ +@@ -171,16 +172,16 @@ public final class C2BConverter { result.throwException(); } else if (result.isOverflow()) { // Propagate current positions to the byte chunk and char chunk @@ -1411,8 +1454,10 @@ cc.get(leftovers.array(), 0, cc.remaining()); } } ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/Utf8Decoder.java 2020-02-05 20:42:41.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/Utf8Decoder.java 2020-02-25 14:10:19.670974359 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/Utf8Decoder.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/buf/Utf8Decoder.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/Utf8Decoder.java @@ -16,6 +16,7 @@ */ package org.apache.tomcat.util.buf; @@ -1421,7 +1466,7 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharsetDecoder; -@@ -140,7 +141,7 @@ +@@ -140,7 +141,7 @@ public class Utf8Decoder extends Charset } return CoderResult.UNDERFLOW; } finally { @@ -1430,7 +1475,7 @@ } } -@@ -163,8 +164,8 @@ +@@ -163,8 +164,8 @@ public class Utf8Decoder extends Charset // If first byte is invalid, tail will be set to -1 int tail = remainingBytes[jchar]; if (tail == -1) { @@ -1441,7 +1486,7 @@ return CoderResult.malformedForLength(1); } // Additional checks to detect invalid sequences ASAP -@@ -175,72 +176,72 @@ +@@ -175,72 +176,72 @@ public class Utf8Decoder extends Charset // First byte C2..DF, second byte 80..BF if (jchar > 0x41 && jchar < 0x60 && (bArr[inIndex + 1] & 0xC0) != 0x80) { @@ -1534,7 +1579,7 @@ return CoderResult.malformedForLength(3); } } -@@ -250,8 +251,8 @@ +@@ -250,8 +251,8 @@ public class Utf8Decoder extends Charset for (int i = 0; i < tail; i++) { int nextByte = bArr[inIndex + i + 1] & 0xFF; if ((nextByte & 0xC0) != 0x80) { @@ -1545,7 +1590,7 @@ return CoderResult.malformedForLength(1 + i); } jchar = (jchar << 6) + nextByte; -@@ -259,8 +260,8 @@ +@@ -259,8 +260,8 @@ public class Utf8Decoder extends Charset jchar -= remainingNumbers[tail]; if (jchar < lowerEncodingLimit[tail]) { // Should have been encoded in fewer octets @@ -1556,7 +1601,7 @@ return CoderResult.malformedForLength(1); } inIndex += tail; -@@ -281,8 +282,8 @@ +@@ -281,8 +282,8 @@ public class Utf8Decoder extends Charset // Encoded with 4 bytes. inIndex currently points // to the final byte. Move it back to first byte. inIndex -= 3; @@ -1567,7 +1612,7 @@ return CoderResult.OVERFLOW; } cArr[outIndex++] = (char) ((jchar >> 0xA) + 0xD7C0); -@@ -290,8 +291,8 @@ +@@ -290,8 +291,8 @@ public class Utf8Decoder extends Charset outRemaining -= 2; } } @@ -1578,8 +1623,10 @@ return (outRemaining == 0 && inIndex < inIndexLimit) ? CoderResult.OVERFLOW : CoderResult.UNDERFLOW; ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/Utf8Encoder.java 2020-02-05 20:42:41.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/buf/Utf8Encoder.java 2020-02-25 14:10:19.670974359 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/Utf8Encoder.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/buf/Utf8Encoder.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/buf/Utf8Encoder.java @@ -16,6 +16,7 @@ */ package org.apache.tomcat.util.buf; @@ -1588,7 +1635,7 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharsetEncoder; -@@ -56,8 +57,8 @@ +@@ -56,8 +57,8 @@ public class Utf8Encoder extends Charset if (jchar <= 0x7F) { if (outRemaining < 1) { @@ -1599,7 +1646,7 @@ return CoderResult.OVERFLOW; } bArr[outPos++] = (byte) (jchar & 0xFF); -@@ -65,8 +66,8 @@ +@@ -65,8 +66,8 @@ public class Utf8Encoder extends Charset } else if (jchar <= 0x7FF) { if (outRemaining < 2) { @@ -1610,7 +1657,7 @@ return CoderResult.OVERFLOW; } bArr[outPos++] = (byte) (0xC0 + ((jchar >> 6) & 0x1F)); -@@ -77,21 +78,21 @@ +@@ -77,21 +78,21 @@ public class Utf8Encoder extends Charset // in has to have one byte more. if (limit <= x + 1) { @@ -1638,7 +1685,7 @@ return CoderResult.malformedForLength(1); } -@@ -99,8 +100,8 @@ +@@ -99,8 +100,8 @@ public class Utf8Encoder extends Charset // The surrogate pair ends with a high-surrogate. if (jchar2 < 0xDC00) { @@ -1649,7 +1696,7 @@ return CoderResult.malformedForLength(1); } -@@ -121,8 +122,8 @@ +@@ -121,8 +122,8 @@ public class Utf8Encoder extends Charset } else { if (outRemaining < 3) { @@ -1660,7 +1707,7 @@ return CoderResult.OVERFLOW; } bArr[outPos++] = (byte) (0xE0 + ((jchar >> 12) & 0x0F)); -@@ -131,8 +132,8 @@ +@@ -131,8 +132,8 @@ public class Utf8Encoder extends Charset outRemaining -= 3; } if (outRemaining == 0) { @@ -1671,7 +1718,7 @@ // If both input and output are exhausted, return UNDERFLOW if (x + 1 == limit) { return CoderResult.UNDERFLOW; -@@ -143,8 +144,8 @@ +@@ -143,8 +144,8 @@ public class Utf8Encoder extends Charset } if (rem != 0) { @@ -1682,7 +1729,7 @@ } return CoderResult.UNDERFLOW; } -@@ -228,7 +229,7 @@ +@@ -228,7 +229,7 @@ public class Utf8Encoder extends Charset pos++; } } finally { @@ -1691,9 +1738,11 @@ } return CoderResult.UNDERFLOW; } ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/AprEndpoint.java 2020-02-05 20:42:45.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/AprEndpoint.java 2020-02-25 14:10:19.674974381 +0100 -@@ -20,6 +20,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/AprEndpoint.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/AprEndpoint.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/AprEndpoint.java +@@ -20,6 +20,7 @@ import java.io.EOFException; import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketTimeoutException; @@ -1701,7 +1750,7 @@ import java.nio.ByteBuffer; import java.nio.channels.CompletionHandler; import java.nio.charset.StandardCharsets; -@@ -2040,7 +2041,7 @@ +@@ -2040,7 +2041,7 @@ public class AprEndpoint extends Abstrac // SSL and app buffer size settings with NIO & NIO2. if (endpoint.isSSLEnabled()) { sslOutputBuffer = ByteBuffer.allocateDirect(SSL_OUTPUT_BUFFER_SIZE); @@ -1710,7 +1759,7 @@ } else { sslOutputBuffer = null; } -@@ -2102,7 +2103,7 @@ +@@ -2102,7 +2103,7 @@ public class AprEndpoint extends Abstrac // The socket read buffer capacity is socket.appReadBufSize int limit = socketBufferHandler.getReadBuffer().capacity(); if (to.isDirect() && to.remaining() >= limit) { @@ -1719,7 +1768,7 @@ nRead = fillReadBuffer(block, to); if (log.isDebugEnabled()) { log.debug("Socket: [" + this + "], Read direct from socket: [" + nRead + "]"); -@@ -2181,7 +2182,7 @@ +@@ -2181,7 +2182,7 @@ public class AprEndpoint extends Abstrac } if (result > 0) { @@ -1728,7 +1777,7 @@ return result; } else if (result == 0 || -result == Status.EAGAIN) { return 0; -@@ -2303,9 +2304,9 @@ +@@ -2303,9 +2304,9 @@ public class AprEndpoint extends Abstrac if (getEndpoint().isSSLEnabled()) { if (sslOutputBuffer.remaining() == 0) { // Buffer was fully written last time around @@ -1740,7 +1789,7 @@ } else { // Buffer still has data from previous attempt to write // APR + SSL requires that exactly the same parameters are -@@ -2314,13 +2315,13 @@ +@@ -2314,13 +2315,13 @@ public class AprEndpoint extends Abstrac thisTime = Socket.sendb(getSocket().longValue(), sslOutputBuffer, sslOutputBuffer.position(), sslOutputBuffer.limit()); if (thisTime > 0) { @@ -1756,9 +1805,11 @@ } } if (Status.APR_STATUS_IS_EAGAIN(-thisTime)) { ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/Nio2Endpoint.java 2020-02-05 20:42:45.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/Nio2Endpoint.java 2020-02-25 14:10:19.674974381 +0100 -@@ -22,6 +22,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/Nio2Endpoint.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/Nio2Endpoint.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/Nio2Endpoint.java +@@ -22,6 +22,7 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.net.SocketTimeoutException; @@ -1766,7 +1817,7 @@ import java.nio.ByteBuffer; import java.nio.channels.AsynchronousChannelGroup; import java.nio.channels.AsynchronousCloseException; -@@ -541,7 +542,7 @@ +@@ -541,7 +542,7 @@ public class Nio2Endpoint extends Abstra if (nRead > 0) { getSocket().getBufHandler().configureWriteBufferForRead(); if (attachment.length < buffer.remaining()) { @@ -1775,7 +1826,7 @@ } attachment.length -= nRead; } else { -@@ -895,7 +896,7 @@ +@@ -886,7 +887,7 @@ public class Nio2Endpoint extends Abstra // The socket read buffer capacity is socket.appReadBufSize int limit = socketBufferHandler.getReadBuffer().capacity(); if (block && to.remaining() >= limit) { @@ -1784,9 +1835,11 @@ nRead = fillReadBuffer(block, to); if (log.isDebugEnabled()) { log.debug("Socket: [" + this + "], Read direct from socket: [" + nRead + "]"); ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/NioEndpoint.java 2020-02-05 20:42:45.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/NioEndpoint.java 2020-02-25 14:10:19.674974381 +0100 -@@ -23,6 +23,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/NioEndpoint.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/NioEndpoint.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/NioEndpoint.java +@@ -23,6 +23,7 @@ import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketTimeoutException; @@ -1794,7 +1847,7 @@ import java.nio.ByteBuffer; import java.nio.channels.CancelledKeyException; import java.nio.channels.Channel; -@@ -1154,7 +1155,7 @@ +@@ -1137,7 +1138,7 @@ public class NioEndpoint extends Abstrac // The socket read buffer capacity is socket.appReadBufSize int limit = socketBufferHandler.getReadBuffer().capacity(); if (to.remaining() >= limit) { @@ -1803,8 +1856,10 @@ nRead = fillReadBuffer(block, to); if (log.isDebugEnabled()) { log.debug("Socket: [" + this + "], Read direct from socket: [" + nRead + "]"); ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java 2020-02-05 20:42:46.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java 2020-02-25 14:10:19.674974381 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/openssl/OpenSSLEngine.java @@ -16,6 +16,7 @@ */ package org.apache.tomcat.util.net.openssl; @@ -1813,7 +1868,7 @@ import java.nio.ByteBuffer; import java.nio.ReadOnlyBufferException; import java.security.Principal; -@@ -40,7 +41,7 @@ +@@ -40,7 +41,7 @@ import javax.net.ssl.SSLSessionContext; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -1822,7 +1877,7 @@ import org.apache.tomcat.jni.Pool; import org.apache.tomcat.jni.SSL; import org.apache.tomcat.jni.SSLContext; -@@ -130,7 +131,7 @@ +@@ -130,7 +131,7 @@ public final class OpenSSLEngine extends private static final String INVALID_CIPHER = "SSL_NULL_WITH_NULL_NULL"; @@ -1830,8 +1885,8 @@ + private static final long EMPTY_ADDR = org.apache.tomcat.jni.Buffer.address(ByteBuffer.allocate(0)); // OpenSSL state - private long ssl; -@@ -242,10 +243,10 @@ + private final long ssl; +@@ -242,10 +243,10 @@ public final class OpenSSLEngine extends final int sslWrote; if (src.isDirect()) { @@ -1844,7 +1899,7 @@ return sslWrote; } } else { -@@ -253,17 +254,17 @@ +@@ -253,17 +254,17 @@ public final class OpenSSLEngine extends try { final long addr = memoryAddress(buf); @@ -1866,7 +1921,7 @@ } } finally { buf.clear(); -@@ -282,10 +283,10 @@ +@@ -282,10 +283,10 @@ public final class OpenSSLEngine extends final int pos = src.position(); final int len = src.remaining(); if (src.isDirect()) { @@ -1879,7 +1934,7 @@ return netWrote; } } else { -@@ -297,10 +298,10 @@ +@@ -297,10 +298,10 @@ public final class OpenSSLEngine extends final int netWrote = SSL.writeToBIO(networkBIO, addr, len); if (netWrote >= 0) { @@ -1892,7 +1947,7 @@ } } finally { buf.clear(); -@@ -317,11 +318,11 @@ +@@ -317,11 +318,11 @@ public final class OpenSSLEngine extends private static int readPlaintextData(final long ssl, final ByteBuffer dst) { if (dst.isDirect()) { final int pos = dst.position(); @@ -1906,7 +1961,7 @@ return sslRead; } } else { -@@ -335,9 +336,9 @@ +@@ -335,9 +336,9 @@ public final class OpenSSLEngine extends final int sslRead = SSL.readFromSSL(ssl, addr, len); if (sslRead > 0) { buf.limit(sslRead); @@ -1918,7 +1973,7 @@ return sslRead; } } finally { -@@ -355,10 +356,10 @@ +@@ -355,10 +356,10 @@ public final class OpenSSLEngine extends private static int readEncryptedData(final long networkBIO, final ByteBuffer dst, final int pending) { if (dst.isDirect() && dst.remaining() >= pending) { final int pos = dst.position(); @@ -1931,7 +1986,7 @@ return bioRead; } } else { -@@ -370,9 +371,9 @@ +@@ -370,9 +371,9 @@ public final class OpenSSLEngine extends if (bioRead > 0) { buf.limit(bioRead); int oldLimit = dst.limit(); @@ -1943,7 +1998,7 @@ return bioRead; } } finally { -@@ -963,7 +964,7 @@ +@@ -963,7 +964,7 @@ public final class OpenSSLEngine extends private static long memoryAddress(ByteBuffer buf) { @@ -1952,9 +2007,11 @@ } private SSLEngineResult.Status getEngineStatus() { ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/SecureNio2Channel.java 2020-02-05 20:42:46.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/SecureNio2Channel.java 2020-02-25 14:10:19.674974381 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/SecureNio2Channel.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/SecureNio2Channel.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/SecureNio2Channel.java +@@ -18,6 +18,7 @@ package org.apache.tomcat.util.net; import java.io.EOFException; import java.io.IOException; @@ -1962,7 +2019,7 @@ import java.nio.ByteBuffer; import java.nio.channels.AsynchronousSocketChannel; import java.nio.channels.CompletionHandler; -@@ -133,7 +134,7 @@ +@@ -133,7 +134,7 @@ public class SecureNio2Channel extends N unwrapBeforeRead = true; closed = false; closing = false; @@ -1971,7 +2028,7 @@ } @Override -@@ -323,7 +324,7 @@ +@@ -323,7 +324,7 @@ public class SecureNio2Channel extends N } else if (handshake.getStatus() == Status.BUFFER_UNDERFLOW) { if (netInBuffer.position() == netInBuffer.limit()) { //clear the buffer if we have emptied it out on data @@ -1980,7 +2037,7 @@ } //read more data if (async) { -@@ -418,9 +419,9 @@ +@@ -418,9 +419,9 @@ public class SecureNio2Channel extends N clientRequestedCiphers = Collections.emptyList(); break; case NON_SECURE: @@ -1992,7 +2049,7 @@ flush(); throw new IOException(sm.getString("channel.nio.ssl.foundHttp")); } -@@ -444,8 +445,8 @@ +@@ -444,8 +445,8 @@ public class SecureNio2Channel extends N netOutBuffer = ByteBufferUtils.expand(netOutBuffer, sslEngine.getSession().getPacketBufferSize()); // Set limit and position to expected values @@ -2003,7 +2060,7 @@ // Initiate handshake sslEngine.beginHandshake(); -@@ -469,10 +470,10 @@ +@@ -469,10 +470,10 @@ public class SecureNio2Channel extends N if (!getBufHandler().isReadBufferEmpty()) throw new IOException(sm.getString("channel.nio.ssl.appInputNotEmpty")); if (!getBufHandler().isWriteBufferEmpty()) throw new IOException(sm.getString("channel.nio.ssl.appOutputNotEmpty")); @@ -2018,7 +2075,7 @@ getBufHandler().reset(); handshakeComplete = false; -@@ -521,12 +522,12 @@ +@@ -521,12 +522,12 @@ public class SecureNio2Channel extends N protected SSLEngineResult handshakeWrap() throws IOException { //this should never be called with a network buffer that contains data //so we can clear it here. @@ -2033,7 +2090,7 @@ //set the status handshakeStatus = result.getHandshakeStatus(); return result; -@@ -543,7 +544,7 @@ +@@ -543,7 +544,7 @@ public class SecureNio2Channel extends N //loop while we can perform pure SSLEngine data do { //prepare the buffer with the incoming data @@ -2042,7 +2099,7 @@ //call unwrap getBufHandler().configureReadBufferForWrite(); result = sslEngine.unwrap(netInBuffer, getBufHandler().getReadBuffer()); -@@ -601,7 +602,7 @@ +@@ -601,7 +602,7 @@ public class SecureNio2Channel extends N throw new IOException(sm.getString("channel.nio.ssl.pendingWriteDuringClose"), e); } //prep the buffer for the close message @@ -2051,7 +2108,7 @@ //perform the close, since we called sslEngine.closeOutbound SSLEngineResult handshake = sslEngine.wrap(getEmptyBuf(), netOutBuffer); //we should be in a close state -@@ -609,7 +610,7 @@ +@@ -609,7 +610,7 @@ public class SecureNio2Channel extends N throw new IOException(sm.getString("channel.nio.ssl.invalidCloseState")); } //prepare the buffer for writing @@ -2060,7 +2117,7 @@ //if there is data to be written try { if (timeout > 0) { -@@ -711,7 +712,7 @@ +@@ -711,7 +712,7 @@ public class SecureNio2Channel extends N SSLEngineResult unwrap; do { //prepare the buffer @@ -2069,7 +2126,7 @@ //unwrap the data try { unwrap = sslEngine.unwrap(netInBuffer, dst); -@@ -854,10 +855,10 @@ +@@ -854,10 +855,10 @@ public class SecureNio2Channel extends N protected void wrap() { try { if (!netOutBuffer.hasRemaining()) { @@ -2082,7 +2139,7 @@ if (result.getStatus() == Status.OK) { if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) tasks(); -@@ -909,7 +910,7 @@ +@@ -909,7 +910,7 @@ public class SecureNio2Channel extends N SSLEngineResult unwrap; do { //prepare the buffer @@ -2091,16 +2148,16 @@ //unwrap the data unwrap = sslEngine.unwrap(netInBuffer, dst2); //compact the buffer -@@ -1019,7 +1020,7 @@ +@@ -1017,7 +1018,7 @@ public class SecureNio2Channel extends N + overflowState = OverflowState.DONE; } - processOverflow = false; //prepare the buffer - netInBuffer.flip(); + ((Buffer)netInBuffer).flip(); //unwrap the data unwrap = sslEngine.unwrap(netInBuffer, dsts2, offset, length2); //compact the buffer -@@ -1138,11 +1139,11 @@ +@@ -1137,11 +1138,11 @@ public class SecureNio2Channel extends N } try { // Prepare the output buffer @@ -2114,7 +2171,7 @@ if (result.getStatus() == Status.OK) { if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { tasks(); -@@ -1192,11 +1193,11 @@ +@@ -1191,11 +1192,11 @@ public class SecureNio2Channel extends N } try { // Prepare the output buffer @@ -2128,9 +2185,11 @@ if (result.getStatus() == Status.OK) { if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { tasks(); ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/SecureNioChannel.java 2020-02-05 20:42:46.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/SecureNioChannel.java 2020-02-25 14:10:19.674974381 +0100 -@@ -19,6 +19,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/SecureNioChannel.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/SecureNioChannel.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/SecureNioChannel.java +@@ -19,6 +19,7 @@ package org.apache.tomcat.util.net; import java.io.EOFException; import java.io.IOException; import java.net.SocketTimeoutException; @@ -2138,7 +2197,7 @@ import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; -@@ -95,7 +96,7 @@ +@@ -95,7 +96,7 @@ public class SecureNioChannel extends Ni handshakeComplete = false; closed = false; closing = false; @@ -2147,7 +2206,7 @@ } @Override -@@ -315,9 +316,9 @@ +@@ -315,9 +316,9 @@ public class SecureNioChannel extends Ni clientRequestedCiphers = Collections.emptyList(); break; case NON_SECURE: @@ -2159,7 +2218,7 @@ flushOutbound(); throw new IOException(sm.getString("channel.nio.ssl.foundHttp")); } -@@ -341,8 +342,8 @@ +@@ -341,8 +342,8 @@ public class SecureNioChannel extends Ni netOutBuffer = ByteBufferUtils.expand(netOutBuffer, sslEngine.getSession().getPacketBufferSize()); // Set limit and position to expected values @@ -2170,7 +2229,7 @@ // Initiate handshake sslEngine.beginHandshake(); -@@ -454,12 +455,12 @@ +@@ -454,12 +455,12 @@ public class SecureNioChannel extends Ni protected SSLEngineResult handshakeWrap(boolean doWrite) throws IOException { //this should never be called with a network buffer that contains data //so we can clear it here. @@ -2185,7 +2244,7 @@ //set the status handshakeStatus = result.getHandshakeStatus(); //optimization, if we do have a writable channel, write it now -@@ -479,7 +480,7 @@ +@@ -479,7 +480,7 @@ public class SecureNioChannel extends Ni if (netInBuffer.position() == netInBuffer.limit()) { //clear the buffer if we have emptied it out on data @@ -2194,7 +2253,7 @@ } if (doread) { //if we have data to read, read it -@@ -493,7 +494,7 @@ +@@ -493,7 +494,7 @@ public class SecureNioChannel extends Ni //loop while we can perform pure SSLEngine data do { //prepare the buffer with the incoming data @@ -2203,7 +2262,7 @@ //call unwrap getBufHandler().configureReadBufferForWrite(); result = sslEngine.unwrap(netInBuffer, getBufHandler().getReadBuffer()); -@@ -537,7 +538,7 @@ +@@ -537,7 +538,7 @@ public class SecureNioChannel extends Ni throw new IOException(sm.getString("channel.nio.ssl.remainingDataDuringClose")); } //prep the buffer for the close message @@ -2212,7 +2271,7 @@ //perform the close, since we called sslEngine.closeOutbound SSLEngineResult handshake = sslEngine.wrap(getEmptyBuf(), netOutBuffer); //we should be in a close state -@@ -545,7 +546,7 @@ +@@ -545,7 +546,7 @@ public class SecureNioChannel extends Ni throw new IOException(sm.getString("channel.nio.ssl.invalidCloseState")); } //prepare the buffer for writing @@ -2221,7 +2280,7 @@ //if there is data to be written flush(netOutBuffer); -@@ -612,7 +613,7 @@ +@@ -612,7 +613,7 @@ public class SecureNioChannel extends Ni SSLEngineResult unwrap; do { //prepare the buffer @@ -2230,16 +2289,16 @@ //unwrap the data unwrap = sslEngine.unwrap(netInBuffer, dst); //compact the buffer -@@ -691,7 +692,7 @@ +@@ -689,7 +690,7 @@ public class SecureNioChannel extends Ni + overflowState = OverflowState.DONE; } - processOverflow = false; //prepare the buffer - netInBuffer.flip(); + ((Buffer)netInBuffer).flip(); //unwrap the data unwrap = sslEngine.unwrap(netInBuffer, dsts, offset, length); //compact the buffer -@@ -798,12 +799,12 @@ +@@ -797,12 +798,12 @@ public class SecureNioChannel extends Ni } // The data buffer is empty, we can reuse the entire buffer. @@ -2254,7 +2313,7 @@ if (result.getStatus() == Status.OK) { if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { -@@ -835,12 +836,12 @@ +@@ -834,12 +835,12 @@ public class SecureNioChannel extends Ni } // The data buffer is empty, we can reuse the entire buffer. @@ -2269,17 +2328,19 @@ if (result.getStatus() == Status.OK) { if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) tasks(); ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/SocketBufferHandler.java 2020-02-05 20:42:46.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/SocketBufferHandler.java 2020-02-25 14:10:19.678974403 +0100 -@@ -16,6 +16,7 @@ - */ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/SocketBufferHandler.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/SocketBufferHandler.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/SocketBufferHandler.java +@@ -17,6 +17,7 @@ package org.apache.tomcat.util.net; + import java.nio.BufferOverflowException; +import java.nio.Buffer; import java.nio.ByteBuffer; import org.apache.tomcat.util.buf.ByteBufferUtils; -@@ -66,13 +67,13 @@ +@@ -67,13 +68,13 @@ public class SocketBufferHandler { // Switching to write int remaining = readBuffer.remaining(); if (remaining == 0) { @@ -2295,7 +2356,7 @@ } this.readBufferConfiguredForWrite = readBufferConFiguredForWrite; } -@@ -110,15 +111,15 @@ +@@ -160,15 +161,15 @@ public class SocketBufferHandler { // Switching to write int remaining = writeBuffer.remaining(); if (remaining == 0) { @@ -2315,7 +2376,7 @@ } this.writeBufferConfiguredForWrite = writeBufferConfiguredForWrite; } -@@ -149,9 +150,9 @@ +@@ -199,9 +200,9 @@ public class SocketBufferHandler { public void reset() { @@ -2327,9 +2388,11 @@ writeBufferConfiguredForWrite = true; } ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/SocketWrapperBase.java 2020-02-05 20:42:46.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/SocketWrapperBase.java 2020-02-25 14:10:19.678974403 +0100 -@@ -19,6 +19,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/SocketWrapperBase.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/SocketWrapperBase.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/SocketWrapperBase.java +@@ -19,6 +19,7 @@ package org.apache.tomcat.util.net; import java.io.EOFException; import java.io.IOException; import java.net.SocketTimeoutException; @@ -2337,7 +2400,7 @@ import java.nio.ByteBuffer; import java.nio.channels.CompletionHandler; import java.nio.channels.InterruptedByTimeoutException; -@@ -1468,9 +1469,9 @@ +@@ -1467,9 +1468,9 @@ public abstract class SocketWrapperBase< int max = Math.min(from.remaining(), to.remaining()); if (max > 0) { int fromLimit = from.limit(); @@ -2349,8 +2412,10 @@ } return max; } ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java 2020-02-05 20:42:46.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java 2020-02-25 14:10:19.678974403 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/TLSClientHelloExtractor.java @@ -17,6 +17,7 @@ package org.apache.tomcat.util.net; @@ -2359,7 +2424,7 @@ import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -@@ -76,7 +77,7 @@ +@@ -76,7 +77,7 @@ public class TLSClientHelloExtractor { String sniValue = null; try { // Switch to read mode. @@ -2368,7 +2433,7 @@ // A complete TLS record header is required before we can figure out // how many bytes there are in the record. -@@ -164,8 +165,8 @@ +@@ -164,8 +165,8 @@ public class TLSClientHelloExtractor { this.clientRequestedApplicationProtocols = clientRequestedApplicationProtocols; this.sniValue = sniValue; // Whatever happens, return the buffer to its original state @@ -2379,7 +2444,7 @@ } } -@@ -215,7 +216,7 @@ +@@ -215,7 +216,7 @@ public class TLSClientHelloExtractor { private static boolean isAvailable(ByteBuffer bb, int size) { if (bb.remaining() < size) { @@ -2388,7 +2453,7 @@ return false; } return true; -@@ -243,7 +244,7 @@ +@@ -243,7 +244,7 @@ public class TLSClientHelloExtractor { // the buffer contains a correctly formatted HTTP request line. // The method, target and protocol are not validated. byte chr = 0; @@ -2397,7 +2462,7 @@ // Skip blank lines do { -@@ -324,7 +325,7 @@ +@@ -324,7 +325,7 @@ public class TLSClientHelloExtractor { private static void skipBytes(ByteBuffer bb, int size) { @@ -2406,8 +2471,10 @@ } ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/WriteBuffer.java 2020-02-05 20:42:46.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/util/net/WriteBuffer.java 2020-02-25 14:10:19.678974403 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/WriteBuffer.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/util/net/WriteBuffer.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/util/net/WriteBuffer.java @@ -17,6 +17,7 @@ package org.apache.tomcat.util.net; @@ -2416,9 +2483,11 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Iterator; ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java 2020-02-05 20:42:47.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java 2020-02-25 14:10:19.678974403 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/AsyncChannelWrapperSecure.java +@@ -18,6 +18,7 @@ package org.apache.tomcat.websocket; import java.io.EOFException; import java.io.IOException; @@ -2426,7 +2495,7 @@ import java.nio.ByteBuffer; import java.nio.channels.AsynchronousSocketChannel; import java.nio.channels.CompletionHandler; -@@ -189,7 +190,7 @@ +@@ -189,7 +190,7 @@ public class AsyncChannelWrapperSecure i for (int i = offset; i < offset + length; i++) { ByteBuffer src = srcs[i]; while (src.hasRemaining()) { @@ -2435,7 +2504,7 @@ // Encrypt the data SSLEngineResult r = sslEngine.wrap(src, socketWriteBuffer); -@@ -215,7 +216,7 @@ +@@ -215,7 +216,7 @@ public class AsyncChannelWrapperSecure i } } @@ -2444,7 +2513,7 @@ // Do the write int toWrite = r.bytesProduced(); -@@ -272,7 +273,7 @@ +@@ -272,7 +273,7 @@ public class AsyncChannelWrapperSecure i } } @@ -2453,7 +2522,7 @@ if (socketReadBuffer.hasRemaining()) { // Decrypt the data in the buffer -@@ -358,7 +359,7 @@ +@@ -358,7 +359,7 @@ public class AsyncChannelWrapperSecure i try { sslEngine.beginHandshake(); // So the first compact does the right thing @@ -2462,7 +2531,7 @@ handshakeStatus = sslEngine.getHandshakeStatus(); resultStatus = Status.OK; -@@ -368,11 +369,11 @@ +@@ -368,11 +369,11 @@ public class AsyncChannelWrapperSecure i while(handshaking) { switch (handshakeStatus) { case NEED_WRAP: { @@ -2476,7 +2545,7 @@ Future fWrite = socketChannel.write(socketWriteBuffer); fWrite.get(); -@@ -386,7 +387,7 @@ +@@ -386,7 +387,7 @@ public class AsyncChannelWrapperSecure i socketChannel.read(socketReadBuffer); fRead.get(); } @@ -2485,8 +2554,10 @@ SSLEngineResult r = sslEngine.unwrap(socketReadBuffer, DUMMY); checkResult(r, false); ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2020-02-05 20:42:48.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2020-02-25 14:10:19.678974403 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/PerMessageDeflate.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/websocket/PerMessageDeflate.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/PerMessageDeflate.java @@ -17,6 +17,7 @@ package org.apache.tomcat.websocket; @@ -2495,7 +2566,7 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; -@@ -207,11 +208,11 @@ +@@ -207,11 +208,11 @@ public class PerMessageDeflate implement } catch (NullPointerException e) { throw new IOException(sm.getString("perMessageDeflate.alreadyClosed"), e); } @@ -2509,7 +2580,7 @@ TransformationResult nextResult = next.getMoreData(opCode, fin, (rsv ^ RSV_BITMASK), readBuffer); inflater.setInput( -@@ -355,7 +356,7 @@ +@@ -355,7 +356,7 @@ public class PerMessageDeflate implement int written = deflater.deflate(compressedPayload.array(), compressedPayload.arrayOffset() + compressedPayload.position(), compressedPayload.remaining(), flush); @@ -2518,7 +2589,7 @@ } catch (NullPointerException e) { throw new IOException(sm.getString("perMessageDeflate.alreadyClosed"), e); } -@@ -375,7 +376,7 @@ +@@ -375,7 +376,7 @@ public class PerMessageDeflate implement writeBuffer = ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE); // Flip the compressed payload ready for writing @@ -2527,7 +2598,7 @@ boolean fin = uncompressedPart.isFin(); boolean full = compressedPayload.limit() == compressedPayload.capacity(); -@@ -384,7 +385,7 @@ +@@ -384,7 +385,7 @@ public class PerMessageDeflate implement if (fin && !full && needsInput) { // End of compressed message. Drop EOM bytes and output. @@ -2536,7 +2607,7 @@ compressedPart = new MessagePart(true, getRsv(uncompressedPart), opCode, compressedPayload, uncompressedIntermediateHandler, uncompressedIntermediateHandler, blockingWriteTimeoutExpiry); -@@ -419,7 +420,7 @@ +@@ -419,7 +420,7 @@ public class PerMessageDeflate implement } if (eomBufferWritten < EOM_BUFFER.length) { // EOM has just been completed @@ -2545,9 +2616,11 @@ compressedPart = new MessagePart(true, getRsv(uncompressedPart), opCode, compressedPayload, uncompressedIntermediateHandler, uncompressedIntermediateHandler, ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/server/WsFrameServer.java 2020-02-05 20:42:49.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/server/WsFrameServer.java 2020-02-25 14:10:19.678974403 +0100 -@@ -19,6 +19,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/server/WsFrameServer.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/websocket/server/WsFrameServer.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/server/WsFrameServer.java +@@ -19,6 +19,7 @@ package org.apache.tomcat.websocket.serv import java.io.EOFException; import java.io.IOException; import java.nio.ByteBuffer; @@ -2555,7 +2628,7 @@ import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; -@@ -67,10 +68,10 @@ +@@ -67,10 +68,10 @@ public class WsFrameServer extends WsFra while (isOpen() && !isSuspended()) { // Fill up the input buffer with as much data as we can @@ -2569,8 +2642,10 @@ if (read < 0) { throw new EOFException(); } else if (read == 0) { ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsFrameBase.java 2020-02-05 20:42:48.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsFrameBase.java 2020-02-25 14:10:19.678974403 +0100 +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsFrameBase.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/websocket/WsFrameBase.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsFrameBase.java @@ -17,6 +17,7 @@ package org.apache.tomcat.websocket; @@ -2579,7 +2654,7 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharsetDecoder; -@@ -91,7 +92,7 @@ +@@ -91,7 +92,7 @@ public abstract class WsFrameBase { public WsFrameBase(WsSession wsSession, Transformation transformation) { inputBuffer = ByteBuffer.allocate(Constants.DEFAULT_BUFFER_SIZE); @@ -2588,7 +2663,7 @@ messageBufferBinary = ByteBuffer.allocate(wsSession.getMaxBinaryMessageBufferSize()); messageBufferText = CharBuffer.allocate(wsSession.getMaxTextMessageBufferSize()); wsSession.setWsFrame(this); -@@ -257,11 +258,11 @@ +@@ -257,11 +258,11 @@ public abstract class WsFrameBase { if (payloadLength == 126) { payloadLength = byteArrayToLong(inputBuffer.array(), inputBuffer.arrayOffset() + inputBuffer.position(), 2); @@ -2602,7 +2677,7 @@ } if (Util.isControl(opCode)) { if (payloadLength > 125) { -@@ -313,13 +314,13 @@ +@@ -313,13 +314,13 @@ public abstract class WsFrameBase { // Control messages have fixed message size so // TransformationResult.OVERFLOW is not possible here @@ -2618,7 +2693,7 @@ // Payload must be zero or 2+ bytes long throw new WsIOException(new CloseReason( CloseCodes.PROTOCOL_ERROR, -@@ -331,8 +332,8 @@ +@@ -331,8 +332,8 @@ public abstract class WsFrameBase { CoderResult cr = utf8DecoderControl.decode(controlBufferBinary, controlBufferText, true); if (cr.isError()) { @@ -2629,7 +2704,7 @@ throw new WsIOException(new CloseReason( CloseCodes.PROTOCOL_ERROR, sm.getString("wsFrame.invalidUtf8Close"))); -@@ -340,7 +341,7 @@ +@@ -340,7 +341,7 @@ public abstract class WsFrameBase { // There will be no overflow as the output buffer is big // enough. There will be no underflow as all the data is // passed to the decoder in a single call. @@ -2638,7 +2713,7 @@ reason = controlBufferText.toString(); } } -@@ -357,17 +358,17 @@ +@@ -357,17 +358,17 @@ public abstract class WsFrameBase { } catch (Throwable t) { handleThrowableOnSend(t); } finally { @@ -2659,7 +2734,7 @@ newFrame(); return true; } -@@ -397,7 +398,7 @@ +@@ -397,7 +398,7 @@ public abstract class WsFrameBase { } catch (Throwable t) { handleThrowableOnSend(t); } finally { @@ -2668,7 +2743,7 @@ } } -@@ -408,7 +409,7 @@ +@@ -408,7 +409,7 @@ public abstract class WsFrameBase { while (!TransformationResult.END_OF_FRAME.equals(tr)) { // Frame not complete - we ran out of something // Convert bytes to UTF-8 @@ -2677,7 +2752,7 @@ while (true) { CoderResult cr = utf8DecoderMessage.decode(messageBufferBinary, messageBufferText, false); -@@ -419,9 +420,9 @@ +@@ -419,9 +420,9 @@ public abstract class WsFrameBase { } else if (cr.isOverflow()) { // Ran out of space in text buffer - flush it if (usePartial()) { @@ -2689,7 +2764,7 @@ } else { throw new WsIOException(new CloseReason( CloseCodes.TOO_BIG, -@@ -448,7 +449,7 @@ +@@ -448,7 +449,7 @@ public abstract class WsFrameBase { tr = transformation.getMoreData(opCode, fin, rsv, messageBufferBinary); } @@ -2698,7 +2773,7 @@ boolean last = false; // Frame is fully received // Convert bytes to UTF-8 -@@ -462,9 +463,9 @@ +@@ -462,9 +463,9 @@ public abstract class WsFrameBase { } else if (cr.isOverflow()) { // Ran out of space in text buffer - flush it if (usePartial()) { @@ -2710,7 +2785,7 @@ } else { throw new WsIOException(new CloseReason( CloseCodes.TOO_BIG, -@@ -477,9 +478,9 @@ +@@ -477,9 +478,9 @@ public abstract class WsFrameBase { // If partial messages are supported, send what we have // managed to decode if (usePartial()) { @@ -2722,7 +2797,7 @@ } messageBufferBinary.compact(); newFrame(); -@@ -491,7 +492,7 @@ +@@ -491,7 +492,7 @@ public abstract class WsFrameBase { } } else { // End of message @@ -2731,7 +2806,7 @@ sendMessageText(true); newMessage(); -@@ -519,12 +520,12 @@ +@@ -519,12 +520,12 @@ public abstract class WsFrameBase { Long.valueOf(payloadLength))); throw new WsIOException(cr); } @@ -2747,7 +2822,7 @@ // Read more data tr = transformation.getMoreData(opCode, fin, rsv, messageBufferBinary); } -@@ -534,12 +535,12 @@ +@@ -534,12 +535,12 @@ public abstract class WsFrameBase { // - partial messages are supported // - the message is complete if (usePartial() || !continuationExpected) { @@ -2763,7 +2838,7 @@ } if (continuationExpected) { -@@ -588,8 +589,8 @@ +@@ -588,8 +589,8 @@ public abstract class WsFrameBase { private void newMessage() { @@ -2774,7 +2849,7 @@ utf8DecoderMessage.reset(); continuationExpected = false; newFrame(); -@@ -598,7 +599,7 @@ +@@ -598,7 +599,7 @@ public abstract class WsFrameBase { private void newFrame() { if (inputBuffer.remaining() == 0) { @@ -2783,7 +2858,7 @@ } maskIndex = 0; -@@ -631,7 +632,7 @@ +@@ -631,7 +632,7 @@ public abstract class WsFrameBase { private void makeRoom() { inputBuffer.compact(); @@ -2792,7 +2867,7 @@ } -@@ -649,7 +650,7 @@ +@@ -649,7 +650,7 @@ public abstract class WsFrameBase { private boolean swallowInput() { long toSkip = Math.min(payloadLength - payloadWritten, inputBuffer.remaining()); @@ -2801,7 +2876,7 @@ payloadWritten += toSkip; if (payloadWritten == payloadLength) { if (continuationExpected) { -@@ -945,9 +946,9 @@ +@@ -945,9 +946,9 @@ public abstract class WsFrameBase { toWrite = Math.min(toWrite, dest.remaining()); int orgLimit = inputBuffer.limit(); @@ -2813,9 +2888,11 @@ payloadWritten += toWrite; if (payloadWritten == payloadLength) { ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsFrameClient.java 2020-02-05 20:42:48.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsFrameClient.java 2020-02-25 14:10:19.678974403 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsFrameClient.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/websocket/WsFrameClient.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsFrameClient.java +@@ -18,6 +18,7 @@ package org.apache.tomcat.websocket; import java.io.EOFException; import java.io.IOException; @@ -2823,7 +2900,7 @@ import java.nio.ByteBuffer; import java.nio.channels.CompletionHandler; -@@ -76,8 +77,8 @@ +@@ -76,8 +77,8 @@ public class WsFrameClient extends WsFra // and then a new socket read will be performed return; } @@ -2834,7 +2911,7 @@ int toCopy = Math.min(response.remaining(), inputBuffer.remaining()); -@@ -85,16 +86,16 @@ +@@ -85,16 +86,16 @@ public class WsFrameClient extends WsFra // frame processing int orgLimit = response.limit(); @@ -2855,7 +2932,7 @@ // Get some more data if (isOpen()) { -@@ -159,7 +160,7 @@ +@@ -159,7 +160,7 @@ public class WsFrameClient extends WsFra // No data to process return; } @@ -2864,7 +2941,7 @@ doResumeProcessing(true); } -@@ -169,7 +170,7 @@ +@@ -169,7 +170,7 @@ public class WsFrameClient extends WsFra // response will be empty if this exception is thrown response = ByteBuffer .allocate(((ReadBufferOverflowException) exc).getMinBufferSize()); @@ -2873,9 +2950,11 @@ doResumeProcessing(false); } else { close(exc); ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java 2020-02-05 20:42:48.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java 2020-02-25 14:10:19.678974403 +0100 -@@ -20,6 +20,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java +@@ -20,6 +20,7 @@ import java.io.IOException; import java.io.OutputStream; import java.io.Writer; import java.net.SocketTimeoutException; @@ -2883,7 +2962,7 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharsetEncoder; -@@ -240,13 +241,13 @@ +@@ -240,13 +241,13 @@ public abstract class WsRemoteEndpointIm long timeoutExpiry = getTimeoutExpiry(); boolean isDone = false; while (!isDone) { @@ -2899,7 +2978,7 @@ sendMessageBlock(Constants.OPCODE_TEXT, encoderBuffer, last && isDone, timeoutExpiry); } stateMachine.complete(last); -@@ -321,7 +322,7 @@ +@@ -321,7 +322,7 @@ public abstract class WsRemoteEndpointIm } if (payload != null) { @@ -2908,7 +2987,7 @@ } endMessage(null, null); -@@ -433,7 +434,7 @@ +@@ -433,7 +434,7 @@ public abstract class WsRemoteEndpointIm if (Constants.INTERNAL_OPCODE_FLUSH == mp.getOpCode()) { nextFragmented = fragmented; nextText = text; @@ -2917,7 +2996,7 @@ SendHandler flushHandler = new OutputBufferFlushSendHandler( outputBuffer, mp.getEndHandler()); doWrite(flushHandler, mp.getBlockingWriteTimeoutExpiry(), outputBuffer); -@@ -482,10 +483,10 @@ +@@ -482,10 +483,10 @@ public abstract class WsRemoteEndpointIm mask = null; } @@ -2930,7 +3009,7 @@ if (getBatchingAllowed() || isMasked()) { // Need to write via output buffer -@@ -798,13 +799,13 @@ +@@ -798,13 +799,13 @@ public abstract class WsRemoteEndpointIm } public void write() { @@ -2946,7 +3025,7 @@ endpoint.startMessage(Constants.OPCODE_TEXT, buffer, isDone && isLast, this); } -@@ -865,7 +866,7 @@ +@@ -865,7 +866,7 @@ public abstract class WsRemoteEndpointIm } if (headerBuffer.hasRemaining()) { // Still more headers to write, need to flush @@ -2955,7 +3034,7 @@ endpoint.doWrite(this, blockingWriteTimeoutExpiry, outputBuffer); return; } -@@ -879,7 +880,7 @@ +@@ -879,7 +880,7 @@ public abstract class WsRemoteEndpointIm if (payloadLeft > outputSpace) { toWrite = outputSpace; // Temporarily reduce the limit @@ -2964,7 +3043,7 @@ } if (mask == null) { -@@ -897,15 +898,15 @@ +@@ -897,15 +898,15 @@ public abstract class WsRemoteEndpointIm if (payloadLeft > outputSpace) { // Restore the original limit @@ -2983,7 +3062,7 @@ if (outputBuffer.remaining() == 0) { handler.onResult(SENDRESULT_OK); } else { -@@ -923,7 +924,7 @@ +@@ -923,7 +924,7 @@ public abstract class WsRemoteEndpointIm if (outputBuffer.hasRemaining()) { endpoint.doWrite(this, blockingWriteTimeoutExpiry, outputBuffer); } else { @@ -2992,7 +3071,7 @@ write(); } } else { -@@ -949,7 +950,7 @@ +@@ -949,7 +950,7 @@ public abstract class WsRemoteEndpointIm @Override public void onResult(SendResult result) { if (result.isOK()) { @@ -3001,7 +3080,7 @@ } handler.onResult(result); } -@@ -1042,11 +1043,11 @@ +@@ -1042,11 +1043,11 @@ public abstract class WsRemoteEndpointIm private void doWrite(boolean last) throws IOException { if (used) { @@ -3015,7 +3094,7 @@ } } -@@ -1121,9 +1122,9 @@ +@@ -1121,9 +1122,9 @@ public abstract class WsRemoteEndpointIm private void doWrite(boolean last) throws IOException { if (used) { @@ -3027,9 +3106,11 @@ } else { endpoint.stateMachine.complete(last); } ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsSession.java 2020-02-05 20:42:48.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsSession.java 2020-02-25 14:10:19.678974403 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsSession.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/websocket/WsSession.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsSession.java +@@ -18,6 +18,7 @@ package org.apache.tomcat.websocket; import java.io.IOException; import java.net.URI; @@ -3037,7 +3118,7 @@ import java.nio.ByteBuffer; import java.nio.channels.WritePendingException; import java.nio.charset.StandardCharsets; -@@ -607,7 +608,7 @@ +@@ -607,7 +608,7 @@ public class WsSession implements Sessio if (reason != null && reason.length() > 0) { appendCloseReasonWithTruncation(msg, reason); } @@ -3046,9 +3127,11 @@ try { wsRemoteEndpoint.sendMessageBlock(Constants.OPCODE_CLOSE, msg, true); } catch (IOException | WritePendingException e) { ---- apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 2020-02-05 20:42:48.000000000 +0100 -+++ apache-tomcat-9.0.31-src/java/org/apache/tomcat/websocket/WsWebSocketContainer.java 2020-02-25 14:10:19.678974403 +0100 -@@ -27,6 +27,7 @@ +Index: apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsWebSocketContainer.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/java/org/apache/tomcat/websocket/WsWebSocketContainer.java ++++ apache-tomcat-9.0.33-src/java/org/apache/tomcat/websocket/WsWebSocketContainer.java +@@ -27,6 +27,7 @@ import java.net.ProxySelector; import java.net.SocketAddress; import java.net.URI; import java.net.URISyntaxException; @@ -3056,7 +3139,7 @@ import java.nio.ByteBuffer; import java.nio.channels.AsynchronousChannelGroup; import java.nio.channels.AsynchronousSocketChannel; -@@ -742,7 +743,7 @@ +@@ -742,7 +743,7 @@ public class WsWebSocketContainer implem // Terminating CRLF result.put(CRLF); @@ -3065,7 +3148,7 @@ return result; } -@@ -771,7 +772,7 @@ +@@ -771,7 +772,7 @@ public class WsWebSocketContainer implem newSize = input.capacity() * 2; } ByteBuffer expanded = ByteBuffer.allocate(newSize); @@ -3074,7 +3157,7 @@ expanded.put(input); input = expanded; } -@@ -800,14 +801,14 @@ +@@ -800,14 +801,14 @@ public class WsWebSocketContainer implem while (!readHeaders) { // On entering loop buffer will be empty and at the start of a new // loop the buffer will have been fully read. @@ -3091,9 +3174,11 @@ while (response.hasRemaining() && !readHeaders) { if (line == null) { line = readLine(response); ---- apache-tomcat-9.0.31-src/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java 2020-02-05 20:42:57.000000000 +0100 -+++ apache-tomcat-9.0.31-src/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java 2020-02-25 14:10:19.678974403 +0100 -@@ -25,6 +25,7 @@ +Index: apache-tomcat-9.0.33-src/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java ++++ apache-tomcat-9.0.33-src/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java +@@ -25,6 +25,7 @@ import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.net.Socket; @@ -3101,7 +3186,7 @@ import java.nio.ByteBuffer; import java.nio.channels.CompletionHandler; import java.nio.charset.StandardCharsets; -@@ -215,7 +216,7 @@ +@@ -210,7 +211,7 @@ public class TestUpgradeInternalHandler } private void write(ByteBuffer buffer) { @@ -3110,9 +3195,11 @@ CompletionState state = wrapper.write(BlockingMode.BLOCK, 10, TimeUnit.SECONDS, null, SocketWrapperBase.COMPLETE_WRITE, new CompletionHandler() { @Override public void completed(Long result, Void attachment) { ---- apache-tomcat-9.0.31-src/test/org/apache/coyote/http2/Http2TestBase.java 2020-02-05 20:42:57.000000000 +0100 -+++ apache-tomcat-9.0.31-src/test/org/apache/coyote/http2/Http2TestBase.java 2020-02-25 14:10:19.678974403 +0100 -@@ -23,6 +23,7 @@ +Index: apache-tomcat-9.0.33-src/test/org/apache/coyote/http2/Http2TestBase.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/test/org/apache/coyote/http2/Http2TestBase.java ++++ apache-tomcat-9.0.33-src/test/org/apache/coyote/http2/Http2TestBase.java +@@ -23,6 +23,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; import java.net.SocketException; @@ -3120,7 +3207,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.ArrayList; -@@ -217,7 +218,7 @@ +@@ -222,7 +223,7 @@ public abstract class Http2TestBase exte if (padding != null) { headersPayload.put(padding); } @@ -3129,7 +3216,7 @@ ByteUtil.setThreeBytes(frameHeader, 0, headersPayload.limit()); frameHeader[3] = FrameType.HEADERS.getIdByte(); -@@ -250,7 +251,7 @@ +@@ -255,7 +256,7 @@ public abstract class Http2TestBase exte } hpackEncoder.encode(mimeHeaders, headersPayload); @@ -3138,7 +3225,7 @@ ByteUtil.setThreeBytes(frameHeader, 0, headersPayload.limit()); frameHeader[3] = FrameType.HEADERS.getIdByte(); -@@ -278,7 +279,7 @@ +@@ -283,7 +284,7 @@ public abstract class Http2TestBase exte } hpackEncoder.encode(mimeHeaders, headersPayload); @@ -3147,7 +3234,7 @@ ByteUtil.setThreeBytes(frameHeader, 0, headersPayload.limit()); frameHeader[3] = FrameType.CONTINUATION.getIdByte(); -@@ -368,7 +369,7 @@ +@@ -373,7 +374,7 @@ public abstract class Http2TestBase exte } hpackEncoder.encode(headers, headersPayload); @@ -3156,7 +3243,7 @@ ByteUtil.setThreeBytes(headersFrameHeader, 0, headersPayload.limit()); headersFrameHeader[3] = FrameType.HEADERS.getIdByte(); -@@ -380,18 +381,18 @@ +@@ -385,18 +386,18 @@ public abstract class Http2TestBase exte // Data if (padding != null) { dataPayload.put((byte) (padding.length & 0xFF)); @@ -3178,7 +3265,7 @@ // Size ByteUtil.setThreeBytes(dataFrameHeader, 0, dataPayload.limit()); -@@ -413,7 +414,7 @@ +@@ -418,7 +419,7 @@ public abstract class Http2TestBase exte trailerHeaders.addValue(TRAILER_HEADER_NAME).setString(TRAILER_HEADER_VALUE); hpackEncoder.encode(trailerHeaders, trailersPayload); @@ -3187,7 +3274,7 @@ ByteUtil.setThreeBytes(trailersFrameHeader, 0, trailersPayload.limit()); trailersFrameHeader[3] = FrameType.HEADERS.getIdByte(); -@@ -989,7 +990,7 @@ +@@ -1018,7 +1019,7 @@ public abstract class Http2TestBase exte if (bodyBuffer != null) { if (bodyBuffer.limit() > 0) { trace.append(lastStreamId + "-Body-"); @@ -3196,8 +3283,10 @@ while (bodyBuffer.hasRemaining()) { trace.append((char) bodyBuffer.get()); } ---- apache-tomcat-9.0.31-src/test/org/apache/coyote/http2/TestHpack.java 2020-02-05 20:42:57.000000000 +0100 -+++ apache-tomcat-9.0.31-src/test/org/apache/coyote/http2/TestHpack.java 2020-02-25 14:10:19.678974403 +0100 +Index: apache-tomcat-9.0.33-src/test/org/apache/coyote/http2/TestHpack.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/test/org/apache/coyote/http2/TestHpack.java ++++ apache-tomcat-9.0.33-src/test/org/apache/coyote/http2/TestHpack.java @@ -16,6 +16,7 @@ */ package org.apache.coyote.http2; @@ -3206,7 +3295,7 @@ import java.nio.ByteBuffer; import org.junit.Assert; -@@ -34,13 +35,13 @@ +@@ -34,13 +35,13 @@ public class TestHpack { ByteBuffer output = ByteBuffer.allocate(512); HpackEncoder encoder = new HpackEncoder(); encoder.encode(headers, output); @@ -3223,7 +3312,7 @@ // Size is now 3 after using the table Assert.assertEquals(3, output.remaining()); } -@@ -54,15 +55,15 @@ +@@ -54,15 +55,15 @@ public class TestHpack { ByteBuffer output = ByteBuffer.allocate(512); HpackEncoder encoder = new HpackEncoder(); encoder.encode(headers, output); @@ -3242,7 +3331,7 @@ headers2.recycle(); Assert.assertEquals(3, output.remaining()); // Check that the decoder is using the table right -@@ -120,7 +121,7 @@ +@@ -120,7 +121,7 @@ public class TestHpack { // by another byte output.array()[7] = (byte) -122; output.put((byte) -1); @@ -3251,7 +3340,7 @@ MimeHeaders headers2 = new MimeHeaders(); HpackDecoder decoder = new HpackDecoder(); decoder.setHeaderEmitter(new HeadersListener(headers2)); -@@ -136,7 +137,7 @@ +@@ -136,7 +137,7 @@ public class TestHpack { ByteBuffer output = ByteBuffer.allocate(512); HpackEncoder encoder = new HpackEncoder(); encoder.encode(headers, output); @@ -3260,8 +3349,10 @@ MimeHeaders headers2 = new MimeHeaders(); HpackDecoder decoder = new HpackDecoder(); decoder.setHeaderEmitter(new HeadersListener(headers2)); ---- apache-tomcat-9.0.31-src/test/org/apache/coyote/http2/TestHttp2Limits.java 2020-02-05 20:42:57.000000000 +0100 -+++ apache-tomcat-9.0.31-src/test/org/apache/coyote/http2/TestHttp2Limits.java 2020-02-25 14:10:19.678974403 +0100 +Index: apache-tomcat-9.0.33-src/test/org/apache/coyote/http2/TestHttp2Limits.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/test/org/apache/coyote/http2/TestHttp2Limits.java ++++ apache-tomcat-9.0.33-src/test/org/apache/coyote/http2/TestHttp2Limits.java @@ -17,6 +17,7 @@ package org.apache.coyote.http2; @@ -3270,7 +3361,7 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; -@@ -290,7 +291,7 @@ +@@ -290,7 +291,7 @@ public class TestHttp2Limits extends Htt if (state != State.COMPLETE) { throw new Exception("Unable to build headers"); } @@ -3279,8 +3370,10 @@ log.debug("Headers payload generated of size [" + headersPayload.limit() + "]"); } ---- apache-tomcat-9.0.31-src/test/org/apache/coyote/http2/TestHttp2Section_8_1.java 2020-02-05 20:42:58.000000000 +0100 -+++ apache-tomcat-9.0.31-src/test/org/apache/coyote/http2/TestHttp2Section_8_1.java 2020-02-25 14:10:19.678974403 +0100 +Index: apache-tomcat-9.0.33-src/test/org/apache/coyote/http2/TestHttp2Section_8_1.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/test/org/apache/coyote/http2/TestHttp2Section_8_1.java ++++ apache-tomcat-9.0.33-src/test/org/apache/coyote/http2/TestHttp2Section_8_1.java @@ -16,6 +16,7 @@ */ package org.apache.coyote.http2; @@ -3289,7 +3382,7 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; -@@ -186,7 +187,7 @@ +@@ -186,7 +187,7 @@ public class TestHttp2Section_8_1 extend headers.clear(); headers.add(new Header(":authority", "localhost:" + getPort())); @@ -3298,8 +3391,10 @@ buildSimpleGetRequestPart2(headersFrameHeader, headersPayload, headers , 3); ---- apache-tomcat-9.0.31-src/test/org/apache/tomcat/util/buf/TestUtf8.java 2020-02-05 20:43:00.000000000 +0100 -+++ apache-tomcat-9.0.31-src/test/org/apache/tomcat/util/buf/TestUtf8.java 2020-02-25 14:10:19.678974403 +0100 +Index: apache-tomcat-9.0.33-src/test/org/apache/tomcat/util/buf/TestUtf8.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/test/org/apache/tomcat/util/buf/TestUtf8.java ++++ apache-tomcat-9.0.33-src/test/org/apache/tomcat/util/buf/TestUtf8.java @@ -16,6 +16,7 @@ */ package org.apache.tomcat.util.buf; @@ -3308,7 +3403,7 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.CharsetDecoder; -@@ -579,7 +580,7 @@ +@@ -579,7 +580,7 @@ public class TestUtf8 { // an invalid sequence has been provided for (int i = 0; i < len; i++) { bb.put((byte) testCase.input[i]); @@ -3317,7 +3412,7 @@ CoderResult cr = decoder.decode(bb, cb, false); if (cr.isError()) { int expected = testCase.invalidIndex; -@@ -604,11 +605,11 @@ +@@ -604,11 +605,11 @@ public class TestUtf8 { decoder.onUnmappableCharacter(CodingErrorAction.REPLACE); // Add each byte one at a time. @@ -3332,7 +3427,7 @@ CoderResult cr = decoder.decode(bb, cb, false); if (cr.isError()) { Assert.fail(testCase.description); -@@ -617,12 +618,12 @@ +@@ -617,12 +618,12 @@ public class TestUtf8 { } // For incomplete sequences at the end of the input need to tell // the decoder the input has ended @@ -3347,9 +3442,11 @@ String expected = testCase.outputReplaced; if ((flags & REPLACE_SWALLOWS_TRAILER) != 0) { ---- apache-tomcat-9.0.31-src/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java 2020-02-05 20:43:02.000000000 +0100 -+++ apache-tomcat-9.0.31-src/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java 2020-02-25 14:10:19.678974403 +0100 -@@ -18,6 +18,7 @@ +Index: apache-tomcat-9.0.33-src/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java +=================================================================== +--- apache-tomcat-9.0.33-src.orig/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java ++++ apache-tomcat-9.0.33-src/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java +@@ -18,6 +18,7 @@ package org.apache.tomcat.websocket.pojo import java.io.IOException; import java.net.URI; @@ -3357,7 +3454,7 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; -@@ -604,7 +605,7 @@ +@@ -604,7 +605,7 @@ public class TestEncodingDecoding extend reply.put((byte) 0x12); reply.put((byte) 0x34); reply.put(data); diff --git a/tomcat.changes b/tomcat.changes index c41d964..95b4896 100644 --- a/tomcat.changes +++ b/tomcat.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Mon Mar 30 11:13:09 UTC 2020 - Matei Albu + +- Update to Tomcat 9.0.33. See changelog at + http://tomcat.apache.org/tomcat-9.0-doc/changelog.html#Tomcat_9.0.33_(markt) +- Notable fix: corrected a regression in the improvements to HTTP + header parsing (bsc#1167438) +- Rebased patches: + * tomcat-9.0-javadoc.patch + * tomcat-9.0-osgi-build.patch + * tomcat-9.0.31-java8compat.patch + ------------------------------------------------------------------- Fri Feb 28 10:15:08 UTC 2020 - Matei Albu diff --git a/tomcat.spec b/tomcat.spec index 9585556..637bcd6 100644 --- a/tomcat.spec +++ b/tomcat.spec @@ -22,7 +22,7 @@ %define elspec 3.0 %define major_version 9 %define minor_version 0 -%define micro_version 31 +%define micro_version 33 %define packdname apache-tomcat-%{version}-src # FHS 2.3 compliant tree structure - http://www.pathname.com/fhs/2.3/ %global basedir /srv/%{name}