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 2022/06/28 19:37:55 UTC

[tomcat] 03/03: Fix logic for sending HTTP/2 pings

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 4bd90299ab2a6aa4a73d1fb9904b942e3a3f9e5c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jun 28 19:52:30 2022 +0100

    Fix logic for sending HTTP/2 pings
---
 java/org/apache/coyote/http2/Http2UpgradeHandler.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/java/org/apache/coyote/http2/Http2UpgradeHandler.java b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
index fed4383972..de33bfded6 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -327,14 +327,13 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH
         // Might not be necessary. init() will handle that.
         init(null);
 
-
         SocketState result = SocketState.CLOSED;
 
         try {
             switch(status) {
             case OPEN_READ:
                 synchronized (socketWrapper) {
-                    if (!socketWrapper.canWrite()) {
+                    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);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org