[Git][java-team/httpcomponents-core][upstream] New upstream version 4.4.16
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Mon Dec 5 13:27:10 GMT 2022
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / httpcomponents-core
Commits:
878826bc by Emmanuel Bourg at 2022-12-05T14:23:42+01:00
New upstream version 4.4.16
- - - - -
10 changed files:
- NOTICE.txt
- RELEASE_NOTES.txt
- httpcore-ab/pom.xml
- httpcore-nio/pom.xml
- httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
- httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
- httpcore-osgi/pom.xml
- httpcore/pom.xml
- httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
- pom.xml
Changes:
=====================================
NOTICE.txt
=====================================
@@ -1,5 +1,5 @@
Apache HttpComponents Core
-Copyright 2005-2020 The Apache Software Foundation
+Copyright 2005-2021 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
=====================================
RELEASE_NOTES.txt
=====================================
@@ -1,3 +1,30 @@
+Release 4.4.16
+-------------------
+
+This is a maintenance release that corrects several defects discovered since release 4.4.15.
+
+Changelog
+-------------------
+
+* HTTPCORE-730: Non-blocking SSL I/O session incorrectly sets read interest when the session
+ is being closed even if the application layer has cleared interest in input causing
+ a busy loop in the I/O event loop and excessive CPU utilization.
+ Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* Consider empty buffered input in appBufferStatus to close the SSLIOSession. (#359)
+ Contributed by Sajinie Kavindya <sajiniekavindya at gmail.com>
+
+* HTTPCORE-720: Discard any remaining decrypted application data after the TLS session
+ has been closed by the local endpoint.
+ Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+* HTTPCORE-716: Evict remaining decrypted input data from SSL I/O session buffers upon
+ session closure. With unexpected input in the session buffers I/O reactors could end up
+ in a tight loop causing excessive CPU utilization.
+ Contributed by Oleg Kalnichevski <olegk at apache.org>
+
+
+
Release 4.4.15
-------------------
=====================================
httpcore-ab/pom.xml
=====================================
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.4.15</version>
+ <version>4.4.16</version>
</parent>
<artifactId>httpcore-ab</artifactId>
<name>Apache HttpCore Benchmarking Tool</name>
=====================================
httpcore-nio/pom.xml
=====================================
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.4.15</version>
+ <version>4.4.16</version>
</parent>
<artifactId>httpcore-nio</artifactId>
<name>Apache HttpCore NIO</name>
=====================================
httpcore-nio/src/main/java/org/apache/http/nio/pool/AbstractNIOConnPool.java
=====================================
@@ -460,12 +460,10 @@ public abstract class AbstractNIOConnPool<T, C, E extends PoolEntry<T, C>>
}
final int totalAvailable = this.available.size();
if (totalAvailable > freeCapacity - 1) {
- if (!this.available.isEmpty()) {
- final E lastUsed = this.available.removeLast();
- lastUsed.close();
- final RouteSpecificPool<T, C, E> otherpool = getPool(lastUsed.getRoute());
- otherpool.remove(lastUsed);
- }
+ final E lastUsed = this.available.removeLast();
+ lastUsed.close();
+ final RouteSpecificPool<T, C, E> otherpool = getPool(lastUsed.getRoute());
+ otherpool.remove(lastUsed);
}
final SocketAddress localAddress;
=====================================
httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
=====================================
@@ -99,6 +99,7 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
private volatile SSLMode sslMode;
private volatile int status;
private volatile boolean initialized;
+ private volatile boolean terminated;
/**
* Creates new instance of {@code SSLIOSession} class. The instances created uses a
@@ -391,8 +392,7 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
}
if (this.status == CLOSING && this.sslEngine.isOutboundDone()
&& (this.endOfStream || this.sslEngine.isInboundDone())
- && !this.inPlain.hasData()
- && this.appBufferStatus != null && !this.appBufferStatus.hasBufferedInput()) {
+ && (this.terminated || (!this.inPlain.hasData() && (this.appBufferStatus == null || !this.appBufferStatus.hasBufferedInput())))) {
this.status = CLOSED;
}
// Abnormal session termination
@@ -427,8 +427,6 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
!this.inPlain.hasData() &&
(this.appBufferStatus == null || !this.appBufferStatus.hasBufferedInput())) {
newMask = newMask & ~EventMask.READ;
- } else if (this.status == CLOSING) {
- newMask = newMask | EventMask.READ;
}
// Do we have encrypted data ready to be sent?
@@ -549,6 +547,14 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
if (status == HandshakeStatus.NOT_HANDSHAKING || status == HandshakeStatus.FINISHED) {
decryptData();
}
+ if (this.terminated) {
+ // Discard any remaining input data
+ final ByteBuffer inPlainBuf = this.inPlain.acquire();
+ inPlainBuf.clear();
+ if (inPlainBuf.position() == 0) {
+ this.inPlain.release();
+ }
+ }
} while (this.sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_TASK);
// Some decrypted data is available or at the end of stream
return (this.appEventMask & SelectionKey.OP_READ) > 0
@@ -641,6 +647,7 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
@Override
public synchronized void close() {
+ this.terminated = true;
if (this.status >= CLOSING) {
return;
}
@@ -648,6 +655,7 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
if (this.session.getSocketTimeout() == 0) {
this.session.setSocketTimeout(1000);
}
+
try {
updateEventMask();
} catch (final CancelledKeyException ex) {
=====================================
httpcore-osgi/pom.xml
=====================================
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.4.15</version>
+ <version>4.4.16</version>
</parent>
<artifactId>httpcore-osgi</artifactId>
<name>Apache HttpCore OSGi bundle</name>
=====================================
httpcore/pom.xml
=====================================
@@ -28,7 +28,7 @@
<parent>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-core</artifactId>
- <version>4.4.15</version>
+ <version>4.4.16</version>
</parent>
<artifactId>httpcore</artifactId>
<name>Apache HttpCore</name>
=====================================
httpcore/src/main/java/org/apache/http/pool/AbstractConnPool.java
=====================================
@@ -369,12 +369,10 @@ public abstract class AbstractConnPool<T, C, E extends PoolEntry<T, C>>
if (freeCapacity > 0) {
final int totalAvailable = this.available.size();
if (totalAvailable > freeCapacity - 1) {
- if (!this.available.isEmpty()) {
- final E lastUsed = this.available.removeLast();
- lastUsed.close();
- final RouteSpecificPool<T, C, E> otherpool = getPool(lastUsed.getRoute());
- otherpool.remove(lastUsed);
- }
+ final E lastUsed = this.available.removeLast();
+ lastUsed.close();
+ final RouteSpecificPool<T, C, E> otherpool = getPool(lastUsed.getRoute());
+ otherpool.remove(lastUsed);
}
final C conn = this.connFactory.create(route);
entry = pool.add(conn);
=====================================
pom.xml
=====================================
@@ -33,7 +33,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>httpcomponents-core</artifactId>
<name>Apache HttpComponents Core</name>
- <version>4.4.15</version>
+ <version>4.4.16</version>
<description>Apache HttpComponents Core is a library of components for building HTTP enabled services</description>
<url>http://hc.apache.org/httpcomponents-core-ga</url>
<inceptionYear>2005</inceptionYear>
@@ -61,9 +61,17 @@
<connection>scm:git:https://git-wip-us.apache.org/repos/asf/httpcomponents-core.git</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/httpcomponents-core.git</developerConnection>
<url>https://github.com/apache/httpcomponents-core/tree/${project.scm.tag}</url>
- <tag>4.4.15</tag>
+ <tag>4.4.16</tag>
</scm>
+ <distributionManagement>
+ <site>
+ <id>apache.website</id>
+ <name>Apache HttpComponents Website</name>
+ <url>scm:svn:https://svn.apache.org/repos/asf/httpcomponents/site/components/httpcomponents-core-4.4.x/LATEST/</url>
+ </site>
+ </distributionManagement>
+
<modules>
<module>httpcore</module>
<module>httpcore-nio</module>
@@ -81,7 +89,6 @@
<mockito.version>1.10.19</mockito.version>
<commons-logging.version>1.2</commons-logging.version>
<api.comparison.version>4.4</api.comparison.version>
- <hc.stylecheck.version>1</hc.stylecheck.version>
</properties>
<dependencyManagement>
@@ -241,55 +248,17 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
- <encoding>UTF-8</encoding>
+ <configLocation>hc-stylecheck/default.xml</configLocation>
+ <headerLocation>hc-stylecheck/asl2.header</headerLocation>
+ <consoleOutput>true</consoleOutput>
+ <failsOnError>true</failsOnError>
+ <linkXRef>false</linkXRef>
+ <sourceDirectories>
+ <sourceDirectory>${basedir}/src/main/</sourceDirectory>
+ <sourceDirectory>${basedir}/src/test</sourceDirectory>
+ </sourceDirectories>
+ <excludes>**/java-deprecated/**</excludes>
</configuration>
- <executions>
- <execution>
- <id>validate-main</id>
- <phase>validate</phase>
- <configuration>
- <configLocation>hc-stylecheck/default.xml</configLocation>
- <headerLocation>hc-stylecheck/asl2.header</headerLocation>
- <consoleOutput>true</consoleOutput>
- <failsOnError>true</failsOnError>
- <linkXRef>false</linkXRef>
- <sourceDirectory>${basedir}/src/main</sourceDirectory>
- </configuration>
- <goals>
- <goal>checkstyle</goal>
- </goals>
- </execution>
- <execution>
- <id>validate-test</id>
- <phase>validate</phase>
- <configuration>
- <configLocation>hc-stylecheck/default.xml</configLocation>
- <headerLocation>hc-stylecheck/asl2.header</headerLocation>
- <consoleOutput>true</consoleOutput>
- <failsOnError>true</failsOnError>
- <linkXRef>false</linkXRef>
- <sourceDirectory>${basedir}/src/test</sourceDirectory>
- </configuration>
- <goals>
- <goal>checkstyle</goal>
- </goals>
- </execution>
- <execution>
- <id>validate-examples</id>
- <phase>validate</phase>
- <configuration>
- <configLocation>hc-stylecheck/minimal.xml</configLocation>
- <headerLocation>hc-stylecheck/asl2.header</headerLocation>
- <consoleOutput>true</consoleOutput>
- <failsOnError>true</failsOnError>
- <linkXRef>false</linkXRef>
- <sourceDirectory>${basedir}/src/examples</sourceDirectory>
- </configuration>
- <goals>
- <goal>checkstyle</goal>
- </goals>
- </execution>
- </executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -351,7 +320,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
- <version>${hc.clirr.version}</version>
<configuration>
<comparisonVersion>${api.comparison.version}</comparisonVersion>
</configuration>
View it on GitLab: https://salsa.debian.org/java-team/httpcomponents-core/-/commit/878826bc8db5f585611656900e292f6047ca4af3
--
View it on GitLab: https://salsa.debian.org/java-team/httpcomponents-core/-/commit/878826bc8db5f585611656900e292f6047ca4af3
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20221205/d5fadb04/attachment.htm>
More information about the pkg-java-commits
mailing list