Author: remy.maucherat(a)jboss.com
Date: 2014-05-23 10:13:07 -0400 (Fri, 23 May 2014)
New Revision: 2416
Modified:
branches/7.4.x/src/main/java/org/apache/catalina/connector/CoyoteAdapter.java
branches/7.4.x/src/main/java/org/apache/catalina/connector/InputBuffer.java
branches/7.4.x/src/main/java/org/apache/catalina/connector/OutputBuffer.java
Log:
BZ1100486: Try again, make sure there's no keepalive after an upgraded connection
processing.
Modified: branches/7.4.x/src/main/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
---
branches/7.4.x/src/main/java/org/apache/catalina/connector/CoyoteAdapter.java 2014-05-23
11:31:05 UTC (rev 2415)
+++
branches/7.4.x/src/main/java/org/apache/catalina/connector/CoyoteAdapter.java 2014-05-23
14:13:07 UTC (rev 2416)
@@ -255,6 +255,10 @@
}
if (error || close) {
response.finishResponse();
+ if (request.getUpgradeHandler() != null) {
+ // Ensure no keepalive after upgrade, even if it is not an error
obviously
+ error = true;
+ }
}
return (!error);
} catch (Throwable t) {
Modified: branches/7.4.x/src/main/java/org/apache/catalina/connector/InputBuffer.java
===================================================================
--- branches/7.4.x/src/main/java/org/apache/catalina/connector/InputBuffer.java 2014-05-23
11:31:05 UTC (rev 2415)
+++ branches/7.4.x/src/main/java/org/apache/catalina/connector/InputBuffer.java 2014-05-23
14:13:07 UTC (rev 2416)
@@ -256,10 +256,10 @@
*/
public void close()
throws IOException {
- closed = true;
-
- if (request.getUpgradeHandler() != null) {
+ if (request.getUpgradeHandler() != null && request.isEventMode()) {
request.getEvent().close();
+ } else {
+ closed = true;
}
}
Modified: branches/7.4.x/src/main/java/org/apache/catalina/connector/OutputBuffer.java
===================================================================
---
branches/7.4.x/src/main/java/org/apache/catalina/connector/OutputBuffer.java 2014-05-23
11:31:05 UTC (rev 2415)
+++
branches/7.4.x/src/main/java/org/apache/catalina/connector/OutputBuffer.java 2014-05-23
14:13:07 UTC (rev 2416)
@@ -300,6 +300,12 @@
if (suspended)
return;
+ Request request = response.getRequest();
+ if (request.getUpgradeHandler() != null && request.isEventMode()) {
+ request.getEvent().close();
+ return;
+ }
+
// If there are chars, flush all of them to the byte buffer now as bytes are used
to
// calculate the content-length (if everything fits into the byte buffer, of
course).
if (cb.getLength() > 0) {
@@ -320,10 +326,6 @@
coyoteResponse.finish();
- Request request = response.getRequest();
- if (request.getUpgradeHandler() != null) {
- request.getEvent().close();
- }
}
Show replies by date