You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/09/14 18:47:03 UTC
[tomcat] branch master updated (c2b35b6 -> 83a03b4)
This is an automated email from the ASF dual-hosted git repository.
markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.
from c2b35b6 Update to Commons Daemon 1.2.3
new 58c072a Don't send an HTTP/2 ping when the connection is known to be closing
new 83a03b4 Use UPGRADED to ensure timeouts are processed
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
java/org/apache/coyote/AbstractProtocol.java | 2 +-
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 13 +++++++++++--
webapps/docs/changelog.xml | 11 +++++++++++
3 files changed, 23 insertions(+), 3 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 01/02: Don't send an HTTP/2 ping when the connection is
known to be closing
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 58c072aecbe99a4025308f9e2e6be2b6cf0866ff
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Sep 14 18:47:17 2020 +0100
Don't send an HTTP/2 ping when the connection is known to be closing
---
java/org/apache/coyote/http2/Http2UpgradeHandler.java | 13 +++++++++++--
webapps/docs/changelog.xml | 8 ++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index b4b6fda..0d72451 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -316,10 +316,15 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH
SocketState result = SocketState.CLOSED;
try {
- pingManager.sendPing(false);
-
switch(status) {
case OPEN_READ:
+ synchronized (socketWrapper) {
+ if (!socketWrapper.canWrite()) {
+ // Only send a ping if there is no other data waiting to be sent.
+ // Ping manager will ensure they aren't sent too frequently.
+ pingManager.sendPing(false);
+ }
+ }
try {
// There is data to read so use the read timeout while
// reading frames ...
@@ -827,6 +832,10 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH
synchronized (socketWrapper) {
if (socketWrapper.flush(false)) {
socketWrapper.registerWriteInterest();
+ } else {
+ // Only send a ping if there is no other data waiting to be sent.
+ // Ping manager will ensure they aren't sent too frequently.
+ pingManager.sendPing(false);
}
}
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 895fa31..b840206 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -53,6 +53,14 @@
</update>
</changelog>
</subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ Do not send an HTTP/2 PING frame to measure round-trip time when it is
+ known that the HTTP/2 connection is not in a good state. (markt)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Other">
<changelog>
<update>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[tomcat] 02/02: Use UPGRADED to ensure timeouts are processed
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 83a03b434cb8d9b561656cd1dfaf2f91a0bf79cc
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Sep 14 18:48:13 2020 +0100
Use UPGRADED to ensure timeouts are processed
---
java/org/apache/coyote/AbstractProtocol.java | 2 +-
webapps/docs/changelog.xml | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/coyote/AbstractProtocol.java b/java/org/apache/coyote/AbstractProtocol.java
index 248a26b..e214f80 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -901,7 +901,7 @@ public abstract class AbstractProtocol<S> implements ProtocolHandler,
if (httpUpgradeHandler instanceof InternalHttpUpgradeHandler) {
if (((InternalHttpUpgradeHandler) httpUpgradeHandler).hasAsyncIO()) {
// The handler will initiate all further I/O
- state = SocketState.LONG;
+ state = SocketState.UPGRADED;
}
}
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b840206..e10a44d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -59,6 +59,9 @@
Do not send an HTTP/2 PING frame to measure round-trip time when it is
known that the HTTP/2 connection is not in a good state. (markt)
</fix>
+ <fix>
+ Ensure HTTP/2 timeouts are processed for idle connections. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org