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:32:30 UTC

[tomcat] branch main updated (7977615c10 -> 22bc541097)

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

markt pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


    from 7977615c10 Fix duplicate Poller registration with HTTP/2, NIO and async IO
     new fdd20c32e5 Only need to check socket/network buffers for writes
     new 22bc541097 Fix logic for sending HTTP/2 pings

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/http2/Http2UpgradeHandler.java | 3 +--
 java/org/apache/tomcat/util/net/NioEndpoint.java      | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)


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


[tomcat] 01/02: Only need to check socket/network buffers for writes

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fdd20c32e52613058c19d3d47f3cf74566a0a078
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jun 28 19:51:28 2022 +0100

    Only need to check socket/network buffers for writes
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java
index d4e9d4ec52..ae8d64e6cd 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1638,7 +1638,7 @@ public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,SocketChannel>
                                 }
                             }
                             if (nBytes != 0 || (!buffersArrayHasRemaining(buffers, offset, length) &&
-                                    !socketOrNetworkBufferHasDataLeft())) {
+                                    (read || !socketOrNetworkBufferHasDataLeft()))) {
                                 completionDone = false;
                             }
                         }
@@ -1647,7 +1647,7 @@ public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,SocketChannel>
                     }
                 }
                 if (nBytes > 0 || (nBytes == 0 && !buffersArrayHasRemaining(buffers, offset, length) &&
-                        !socketOrNetworkBufferHasDataLeft())) {
+                        (read || !socketOrNetworkBufferHasDataLeft()))) {
                     // The bytes processed are only updated in the completion handler
                     completion.completed(Long.valueOf(nBytes), this);
                 } else if (nBytes < 0 || getError() != null) {


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


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

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 22bc541097cb6700f4c2c5cf2376e25278ad02cf
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 d0a9b21724..8e285e17ec 100644
--- a/java/org/apache/coyote/http2/Http2UpgradeHandler.java
+++ b/java/org/apache/coyote/http2/Http2UpgradeHandler.java
@@ -329,7 +329,6 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH
         // Might not be necessary. init() will handle that.
         init(null);
 
-
         SocketState result = SocketState.CLOSED;
 
         try {
@@ -337,7 +336,7 @@ class Http2UpgradeHandler extends AbstractStream implements InternalHttpUpgradeH
             case OPEN_READ:
                 socketWrapper.getLock().lock();
                 try {
-                    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