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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new f5f2fa4a78 Fix logic for sending HTTP/2 pings
f5f2fa4a78 is described below

commit f5f2fa4a78dc39003e24a57c6f888649cc105abf
Author: Mark Thomas <[email protected]>
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 e93e29dc49..4d43f7c3ef 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -321,14 +321,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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to