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 2019/09/26 19:28:02 UTC

[tomcat] branch master updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766

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


The following commit(s) were added to refs/heads/master by this push:
     new 70ad92e  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766
70ad92e is described below

commit 70ad92ec5126d07a13366cff22996895ef9604b6
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 26 20:27:24 2019 +0100

    Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63766
    
    Clean-up correctly after an early failure of a WebSocket connection.
---
 java/org/apache/coyote/AbstractProtocol.java | 8 ++++----
 webapps/docs/changelog.xml                   | 5 +++++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/AbstractProtocol.java b/java/org/apache/coyote/AbstractProtocol.java
index d95d425..9753447 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -956,8 +956,9 @@ public abstract class AbstractProtocol<S> implements ProtocolHandler,
                     // The resumeProcessing() method will add this socket
                     // to the poller.
                 } else {
-                    // Connection closed. OK to recycle the processor. Upgrade
-                    // processors are not recycled.
+                    // Connection closed. OK to recycle the processor.
+                    // Processors handling upgrades require additional clean-up
+                    // before release.
                     connections.remove(socket);
                     if (processor.isUpgrade()) {
                         UpgradeToken upgradeToken = processor.getUpgradeToken();
@@ -979,9 +980,8 @@ public abstract class AbstractProtocol<S> implements ProtocolHandler,
                                 upgradeToken.getContextBind().unbind(false, oldCL);
                             }
                         }
-                    } else {
-                        release(processor);
                     }
+                    release(processor);
                 }
                 return state;
             } catch(java.net.SocketException e) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 840fecf..41d9f3f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -64,6 +64,11 @@
         <bug>63765</bug>: NIO2 should try to unwrap after TLS handshake to
         avoid edge cases. (remm)
       </fix>
+      <fix>
+        <bug>63766</bug>: Ensure Processor objects are recycled when processing
+        an HTTP upgrade connection that terminates before processing switches to
+        the Processor for the upgraded procotol. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">


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